You are here

class MessageNotifierEmail in Message Notify 7.2

Email notifier.

Hierarchy

Expanded class hierarchy of MessageNotifierEmail

1 string reference to 'MessageNotifierEmail'
email.inc in plugins/notifier/email/email.inc

File

plugins/notifier/email/MessageNotifierEmail.class.php, line 6

View source
class MessageNotifierEmail extends MessageNotifierBase {
  public function deliver(array $output = array()) {
    $plugin = $this->plugin;
    $message = $this->message;
    $options = $plugin['options'];
    $account = user_load($message->uid);
    $mail = $options['mail'] ? $options['mail'] : $account->mail;
    $languages = language_list();
    if (!$options['language override']) {
      $lang = !empty($account->language) && $account->language != LANGUAGE_NONE ? $languages[$account->language] : language_default();
    }
    else {
      $lang = $languages[$message->language];
    }

    // The subject in an email can't be with HTML, so strip it.
    $output['message_notify_email_subject'] = strip_tags($output['message_notify_email_subject']);

    // Pass the message entity along to hook_drupal_mail().
    $output['message_entity'] = $message;
    $result = drupal_mail('message_notify', $message->type, $mail, $lang, $output);
    return $result['result'];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
MessageNotifierBase::$message protected property The message entity.
MessageNotifierBase::$plugin protected property The plugin definition.
MessageNotifierBase::access public function Determine if user can access notifier. Overrides MessageNotifierInterface::access
MessageNotifierBase::postSend public function Act upon send result. Overrides MessageNotifierInterface::postSend
MessageNotifierBase::send public function Entry point to send and process a message. Overrides MessageNotifierInterface::send
MessageNotifierBase::__construct public function Constructor for the notifier. Overrides MessageNotifierInterface::__construct
MessageNotifierEmail::deliver public function Deliver a message via the required transport method. Overrides MessageNotifierBase::deliver