You are here

function Notifications_Message::set_sender in Notifications 6.3

Same name and namespace in other branches
  1. 6.4 includes/notifications_message.class.inc \Notifications_Message::set_sender()
  2. 7 notifications.message.inc \Notifications_Message::set_sender()

Set sender uid or user account

File

classes/notifications_message.class.inc, line 25
Notifications_Message class

Class

Notifications_Message
@file Notifications_Message class

Code

function set_sender($uid, $sender_option) {
  $sender = notifications_load_user($uid);
  switch ($sender_option) {
    case 2:

      // Full sender account and sender address
      parent::set_sender($sender);
      break;
    case 1:

      // Sender name but anything else defaults to system
      $this->sender = 0;
      $this->sender_name = $sender->name;
      break;
    default:

      // Sender name is site name
      $this->sender = 0;
      $this->sender_name = variable_get('site_name', 'Drupal');
      break;
  }
}