You are here

maillog_tests.module in Maillog / Mail Developer 7

Primary hook implementations for the Maillog test helper module.

File

tests/maillog_tests.module
View source
<?php

/**
 * @file
 * Primary hook implementations for the Maillog test helper module.
 */

/**
 * Implements hook_mail().
 */
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>';
  }
}

Functions

Namesort descending Description
maillog_tests_mail Implements hook_mail().