You are here

function maillog_tests_mail in Maillog / Mail Developer 7

Implements hook_mail().

File

tests/maillog_tests.module, line 11
Primary hook implementations for the Maillog test helper module.

Code

function maillog_tests_mail($key, &$message, $params) {

  // A very rudimentary test.
  if ($key == 'maillog_basic_test') {
    $message['subject'] = t('Test email subject');
    $message['body'][] = t('Test email body.');
  }
  elseif ($key == 'maillog_long_subject_test') {
    $message['subject'] = str_repeat(t('Test email subject') . ' ', 20);
    $message['body'][] = t('Test email body.');
  }
  elseif ($key == 'maillog_subject_xss_test') {
    $message['subject'] = '<script type="text/javascript">alert("XSS test")</script>';
    $message['body'][] = t('Test email body.');
  }
  elseif ($key == 'maillog_body_xss_test') {
    $message['subject'] = t('Test email subject');
    $message['body'][] = '<script type="text/javascript">alert("XSS test")</script>';
  }
}