-
Notifications
You must be signed in to change notification settings - Fork 68
Expand file tree
/
Copy pathMandrillTest.php
More file actions
38 lines (31 loc) · 964 Bytes
/
MandrillTest.php
File metadata and controls
38 lines (31 loc) · 964 Bytes
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
<?php
namespace Tests\E2E;
use Utopia\Messaging\Adapters\Email\Mandrill;
use Utopia\Messaging\Messages\Email;
class MandrillTest extends Base
{
/**
* @throws \Exception
*/
public function testSendEmail()
{
$key = getenv('MANDRILL_API_KEY');
$sender = new Mandrill($key);
$to = getenv('TEST_EMAIL');
$subject = 'Test Subject';
$content = 'Test Content';
$from = getenv('TEST_FROM_EMAIL');
$message = new Email(
to: [$to],
from: $from,
subject: $subject,
content: $content,
);
$response =json_decode($sender->send($message))[0];
$this->assertArrayHasKey('_id',$response);
$this->assertArrayHasKey('email',$response);
$this->assertArrayHasKey('status',$response);
$this->assertArrayHasKey('reject_reason',$response);
$this->assertArrayHasKey('queued_reason',$response);
}
}