You are here

public function MandrillTemplateTestCase::testSendTemplatedMessage in Mandrill 7.2

Test sending a templated message to multiple recipients.

File

modules/mandrill_template/tests/mandrill_template.test, line 60
Test class and methods for the Mandrill Template module.

Class

MandrillTemplateTestCase
@file Test class and methods for the Mandrill Template module.

Code

public function testSendTemplatedMessage() {
  $to = 'Recipient One <recipient.one@example.com>,' . 'Recipient Two <recipient.two@example.com>,' . 'Recipient Three <recipient.three@example.com>';
  $message = $this
    ->getMessageTestData();
  $message['to'] = $to;
  $template_id = 'Test Template';
  $template_content = array(
    'name' => 'Recipient',
  );
  $response = mandrill_template_sender($message, $template_id, $template_content);
  $this
    ->assertNotNull($response, 'Tested response from sending templated message.');
  if (isset($response['status'])) {
    $this
      ->assertNotEqual($response['status'], 'error', 'Tested response status: ' . $response['status'] . ', ' . $response['message']);
  }
}