Last active
January 11, 2023 16:46
-
-
Save aimahdi/83afa2ea687cf1e2d9babeb5b7138799 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('fluentform_before_insert_submission', 'validate_email_reoon', 10, 3); | |
function validate_email_reoon($insertData, $data, $form) | |
{ | |
if($form->id != 633) { //change the form id with your form id | |
return; | |
} | |
$apiKey = 'lYlSwj3Uxt5iGecFTHYdqKC4xBQYaClf'; //put your api key here | |
$apiUrl = 'https://emailverifier.reoon.com/api/v1/verify?email='.$data['email'].'&key='.$apiKey.'&mode=quick'; | |
$response = wp_remote_get($apiUrl); | |
$body = json_decode($response['body']); | |
if($body->status != 'valid'){ | |
return wp_send_json_error("This is not a valid email"); | |
} | |
// DO your stuffs here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment