You are here

function messaging_text_build in Messaging 6.2

Same name and namespace in other branches
  1. 6.4 includes/text.inc \messaging_text_build()
  2. 6.3 messaging.module \messaging_text_build()

Build a simple text with message subject and body

This is useful for methods requiring a simple text instead of header and subject

Parameters

$message: Message object

$glue: Separator to glue subject and body together

2 calls to messaging_text_build()
messaging_sms_send_msg in messaging_sms/messaging_sms.module
Send SMS message using the default gateway
messaging_xmpp_send_msg in messaging_xmpp/messaging_xmpp.module
Send message via the xmppframework

File

./messaging.module, line 924

Code

function messaging_text_build($message, $glue = ' ') {
  $parts = array(
    trim($message->subject),
    trim($message->body),
  );
  $parts = array_filter($parts);
  if ($parts) {
    $text = implode($glue, $parts);
    return $text;
  }
  else {
    return '';
  }
}