You are here

function mail_logger_action_info_alter in Mail Logger 7

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

Implements hook_action_info_alter().

File

./mail_logger.module, line 220
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',
        );
      }
    }
  }
}