You are here

function mail_logger_read_mail in Mail Logger 7

Same name and namespace in other branches
  1. 5 mail_logger.module \mail_logger_read_mail()
  2. 6 mail_logger.module \mail_logger_read_mail()

Page callback at admin/reports/mail-logger/mail/xyz to show a single email.

The menu wildcard loader %mail_logger invokes mail_logger_load, and the resulting $mail object is passed as a parameter.

Parameters

Object $mail: A mail object returned from mail_logger_load().

Return value

String Themed HTML to display a single mail.

1 string reference to 'mail_logger_read_mail'
mail_logger_menu in ./mail_logger.module
Implements hook_menu().

File

./mail_logger.pages.inc, line 124
User-facing UI components for the Mail Logger module.

Code

function mail_logger_read_mail($id) {
  if (!isset($id) || !is_numeric($id)) {
    return 'Invalid Mail Logger ID parameter';
  }
  elseif ($mail = mail_logger_load($id)) {
    drupal_add_css(drupal_get_path('module', 'mail_logger') . '/mail_logger.css');
    return theme('mail_logger_read_mail', array(
      'mail' => $mail,
    ));
  }
  else {
    return t('No Mail Logger record found with id: %id', array(
      '%id' => $id,
    ));
  }
}