• I added the code like this guide but it doesn’t work
    https://fluentforms.com/docs/email-verification-with-truemail/

    `add_filter(‘fluentform_validate_input_item_input_email’, function ($default, $field, $formData, $fields, $form) {

    // You may change the following 3 lines
    $targetFormId = 9;
    $errorMessage = ‘Có v? nh? email b?n ch?a chính xác’; // You may change here
    $trueMailApiKey = ‘xxx’;

    if ($form->id != $targetFormId) {
    return $default;
    }

    $fieldName = $field[‘name’];
    if (empty($formData[$fieldName])) {
    return $default;
    }
    $email = $formData[$fieldName];

    $request = wp_remote_get(‘https://truemail.io/api/v1/verify/single?address_info=1&timeout=5&access_token=’.$trueMailApiKey.’&email=’.$email);

    if(is_wp_error($request)) {
    return $default; // request failed so we are skipping validation
    }

    $response = wp_remote_retrieve_body($request);

    $response = json_decode($response, true);

    if($response[‘result’] == ‘valid’) {
    return $default;
    }

    return $errorMessage;

    }, 10, 5);

    The page I need help with: [log in to see the link]

  • The topic ‘Doesn’t work on my site’ is closed to new replies.