Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save websterl3o/ef515301ce8cb2faf064e87d7c9bebaf to your computer and use it in GitHub Desktop.
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.
<?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 = 'derpino17@gmail.com'; // 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