You are here

mail_debugger.module in Mail Debugger 7

File

mail_debugger.module
View source
<?php

/**
 * Implement hook_menu()
 * @return type
 */
function mail_debugger_menu() {
  return array(
    'admin/people/mail_debugger' => array(
      'title' => "Mail debugger",
      'description' => "Test the mail interface",
      'page arguments' => array(
        'mail_debugger_callback',
      ),
      'page callback' => 'drupal_get_form',
      'access arguments' => array(
        'administer users',
      ),
      'file' => 'includes/mail_debugger.callback.inc',
      'type' => MENU_LOCAL_TASK,
      'weight' => 100,
    ),
  );
}

/**
 * Implement hook_mail()
 * 
 * @param string $key
 * @param array $message
 * @param array $params
 */
function mail_debugger_mail($key, &$message, $params) {
  switch ($key) {
    case 'custom_mail':
      $message['body'] = array(
        $params['body'],
      );
      $message['subject'] = $params['subject'];
      break;
    default:
      break;
  }
}

Functions

Namesort descending Description
mail_debugger_mail Implement hook_mail()
mail_debugger_menu Implement hook_menu()