Created
September 29, 2022 11:47
-
-
Save websterl3o/ef515301ce8cb2faf064e87d7c9bebaf to your computer and use it in GitHub Desktop.
Integração com ElasticEmail/Integration with ElasticEmail PT-BR Esse código é um teste de integração com o ElasticEmail, onde ele verifica o e-mail e retorna se ele é valido. EN This code is an integration test with ElasticEmail, where it checks the email and returns if it is valid.
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
<?php | |
use ElasticEmail\Api\VerificationsApi; | |
use ElasticEmail\Configuration; | |
// API com elastic email validation https://app.elasticemail.com | |
$client = new \GuzzleHttp\Client(); | |
$apiKey = '5BD30809F3075185B5F57D0913273A4C65ACC112E0D9DCBBB7670E5F45567D7CBE05AC53B8D1B81F7B073CC5B71C133B'; | |
$config = Configuration::getDefaultConfiguration()->setApiKey('X-ElasticEmail-ApiKey', $apiKey); | |
$apiInstance = new VerificationsApi( | |
$client, | |
$config | |
); | |
$email = '[email protected]'; // string | |
try { | |
$result = $apiInstance->verificationsByEmailPost($email); | |
print_r($result); | |
} catch (Exception $e) { | |
echo 'Exception when calling VerificationsApi->verificationsByEmailPost: ', $e->getMessage(), PHP_EOL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment