You are here

function mail_logger_action_info_alter in Mail Logger 6

Same name and namespace in other branches
  1. 7 mail_logger.module \mail_logger_action_info_alter()

Implementation of hook_action_info_alter().

File

./mail_logger.module, line 275
Mail Logger module logs all outgoing mail that passes through the drupal_mail function.

Code

function mail_logger_action_info_alter(&$info) {
  foreach ($info as $type => $data) {

    // Allow user & system actions, but don't want an infinite loop with
    // system sent emails.
    if ((stripos($type, "user_") === 0 || strpos($type, "system_") === 0) && $type != 'system_send_email_action') {
      if (isset($info[$type]['hooks']['mail_logger'])) {
        array_merge($info[$type]['hooks']['mail_logger'], array(
          'mail_sent',
        ));
      }
      else {
        $info[$type]['hooks']['mail_logger'] = array(
          'mail_sent',
        );
      }
    }
  }
}