You are here

function mailhandler_report in Mailhandler 6.2

Same name and namespace in other branches
  1. 7.2 mailhandler.module \mailhandler_report()

Unified status- and error-reporting function.

Parameters

$type: One of 'status', 'warning', or 'error'.

$message: Tokenized message to display / log.

$variables: Array of sanitized variables to replace in message.

9 calls to mailhandler_report()
MailhandlerParser::parse in plugins/feeds/plugins/MailhandlerParser.class.php
Implementation of FeedsParser::parse().
MailhandlerPhpImapRetrieve::get_part in modules/mailhandler_php_imap/plugins/mailhandler/retrieve/MailhandlerPhpImapRetrieve.class.php
Gets a message part and adds it to $parts.
MailhandlerPhpImapRetrieve::get_parts in modules/mailhandler_php_imap/plugins/mailhandler/retrieve/MailhandlerPhpImapRetrieve.class.php
Returns an array of parts as file objects
MailhandlerPhpImapRetrieve::open_mailbox in modules/mailhandler_php_imap/plugins/mailhandler/retrieve/MailhandlerPhpImapRetrieve.class.php
Establish IMAP stream connection to specified mailbox.
MailhandlerPhpImapRetrieve::purge_message in modules/mailhandler_php_imap/plugins/mailhandler/retrieve/MailhandlerPhpImapRetrieve.class.php
Purge (mark as read or delete) a message.

... See full list

File

./mailhandler.module, line 212
Retrieves email for posting as nodes and comments.

Code

function mailhandler_report($type, $message, $variables = array()) {
  drupal_set_message(t($message, $variables), $type);
  $mapping = array(
    'status' => WATCHDOG_INFO,
    'warning' => WATCHDOG_WARNING,
    'error' => WATCHDOG_ERROR,
  );
  watchdog('mailhandler', $message, $variables, $mapping[$type]);
  if ($type == 'error') {
    throw new Exception(t($message, $variables));
  }
}