You are here

public function Messaging_Message::prepare in Messaging 6.4

Same name and namespace in other branches
  1. 6.3 classes/messaging_message.class.inc \Messaging_Message::prepare()

Prepare for sending through given method

At this stage, message can be redirected to a different method

2 calls to Messaging_Message::prepare()
Messaging_Message::process in includes/messaging_message.class.inc
Check whether the message is to be sent / queued
Messaging_Message::render in includes/messaging_message.class.inc
Render through sending method

File

includes/messaging_message.class.inc, line 168
Drupal Messaging Framework - Message class file

Class

Messaging_Message
Message class

Code

public function prepare() {
  if (empty($this->prepared)) {
    if ($this
      ->build()) {
      $this
        ->set_destination();

      // Prepare invoking one or more sending methods
      $this->prepared = $this
        ->process_method('message_prepare');
      messaging_debug("Prepared for send method.");
    }
    else {

      // Message building failed, we don't do anything else
      $this->prepared = FALSE;
      $this
        ->message_log("Failed message build.");
    }
  }
  return $this->prepared;
}