-
Notifications
You must be signed in to change notification settings - Fork 13
/
emailverficationAPI.php
42 lines (42 loc) · 1.28 KB
/
emailverficationAPI.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace QuickEmailVerification\Api;
use QuickEmailVerification\HttpClient\HttpClientInterface;
class Quickemailverification implements QuickEmailVerificationInterface
{
/**
* @var HttpClientInterface
*/
private $client;
/**
* @param HttpClientInterface $client
*/
public function __construct(HttpClientInterface $client)
{
$this->client = $client;
}
/**
* Verify email address and get detailed response
*
* '/v1/verify?email=:email' GET
*
* @param $email send email address in query parameter
*/
public function verify($email, array $options = [])
{
$body = isset($options['query']) ? $options['query'] : [];
$body['email'] = $email;
return $this->client->get('/v1/verify', $body, $options);
}
/**
* Return predefined response for predefined email address
*
* '/v1/verify/sandbox?email=:email' GET
*
* @param $email send email address in query parameter
*/
public function sandbox($email, array $options = [])
{
$body = isset($options['query']) ? $options['query'] : [];
$body['email'] = $email;
return $this->client->get('/v1/verify/sandbox', $body, $options);
}