You are here

function pm_email_notify_mail in Privatemsg 6.2

Same name and namespace in other branches
  1. 6 pm_email_notify/pm_email_notify.module \pm_email_notify_mail()
  2. 7.2 pm_email_notify/pm_email_notify.module \pm_email_notify_mail()
  3. 7 pm_email_notify/pm_email_notify.module \pm_email_notify_mail()

Implements hook_mail().

File

pm_email_notify/pm_email_notify.module, line 246
Notifies users about new Private Messages via Email.

Code

function pm_email_notify_mail($key, &$message, $params) {
  $language = $message['language'];
  $variables = user_mail_tokens($params['recipient'], $language);
  $variables = array_merge($variables, _pm_email_notify_token($params['recipient'], $params['message'], $language));
  switch ($key) {
    case 'notice':
      $message['subject'] = strtr(_pm_email_notify_text('subject', $language), $variables);
      $message['body'] = strtr(_pm_email_notify_text('body', $language), $variables);
      break;
  }
}