You are here

function messaging_message_build in Messaging 6.3

Same name and namespace in other branches
  1. 6.4 messaging.module \messaging_message_build()
  2. 7 messaging.module \messaging_message_build()

Build Message object from message array

The $message array may have the following elements 'subject' => Message subject, may be already rendered or not 'body' => Message content, may be already rendered or not 'params' => Optional message params, indexed by sending method group I.e. params for mail methods will be in $message['params']['mail'] 'sender' => Optional int to identify message sender, may be $user->uid 'sender_account' => Optional user account to use as message sender

4 calls to messaging_message_build()
MessagingTestCase::randomMessage in tests/messaging_testcase.inc
messaging_message_send in ./messaging.module
Send message to array of destinations using the same method. The message is rendered just once.
messaging_message_send_out in ./messaging.module
Send for real, finally invoking method's callback function
messaging_message_send_user in ./messaging.module
Send message to user represented by account

File

./messaging.module, line 1175

Code

function messaging_message_build($message) {
  if (is_object($message) && $message instanceof Messaging_Message) {
    return $message;
  }
  else {
    return new Messaging_Message($message);
  }
}