function mail_logger_mail_logger in Mail Logger 6
Same name and namespace in other branches
- 7 mail_logger.module \mail_logger_mail_logger()
Implementation of hook_mail_logger().
File
- ./
mail_logger.module, line 246 - Mail Logger module logs all outgoing mail that passes through the drupal_mail function.
Code
function mail_logger_mail_logger($op, $message, $sender = NULL, $recipient = NULL) {
// We only act on the 'mail_sent' action/rule.
if (!in_array($op, array(
'mail_sent',
))) {
return;
}
// First we trigger the action.
if (module_exists('trigger')) {
$aids = _trigger_get_hook_aids('mail_logger', $op);
$context = array(
'hook' => 'mail_logger',
'op' => $op,
'message' => $message,
'sender' => $sender,
'recipient' => $recipient,
);
actions_do(array_keys($aids), $message, $context);
}
// If the Rules module has been installed, then also trigger the defined rule.
if (module_exists('rules')) {
global $user;
rules_invoke_event('mail_logger_mail_sent', $message, $sender, $recipient, $user);
}
}