0

Please let me know how to use SendGrid Email Validation API in Gravity Forms, using gform_field_validation filter?

Gravity Forms filter example:

add_filter( 'gform_field_validation', function ( $result, $value, $form, $field ) {

  if ( $field->get_input_type() === 'email' && $result['is_valid'] ) {

    // put your code here

  }

  return $result;

}, 10, 4 );

SendGrid Email Validation API:
https://sendgrid.com/docs/ui/managing-contacts/email-address-validation/

Gravity Forms gform_field_validation Filter:
https://docs.gravityforms.com/gform_field_validation/#11-email-validation-by-third-party-api

I want this type of result:

{
  "result": {
    "email": "[email protected]",
    "verdict": "Invalid",
    "score": 0.00089,
    "local": "john.doe",
    "host": "gmial.com",
    "suggestion": "gmail.com",
    "checks": {
      "domain": {
        "has_valid_address_syntax": true,
        "has_mx_or_a_record": true,
        "is_suspected_disposable_address": false
      },
      "local_part": {
        "is_suspected_role_address": false
      },
      "additional": {
        "has_known_bounces": false,
        "has_suspected_bounces": true
      } 
    },
    "ip_address": "123.45.67.89"
  }
}

Thanks in advance :)

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.