You are here

function messaging_sms_render in Messaging 6

Same name and namespace in other branches
  1. 6.4 messaging_sms/messaging_sms.module \messaging_sms_render()
  2. 6.2 messaging_sms/messaging_sms.module \messaging_sms_render()
  3. 6.3 messaging_sms/messaging_sms.module \messaging_sms_render()

Message Render callback

1 string reference to 'messaging_sms_render'
messaging_sms_messaging in messaging_sms/messaging_sms.module
Implementation of hook_messaging

File

messaging_sms/messaging_sms.module, line 31
SMS Messsaging using SMS Framework. Messaging method plug-in

Code

function messaging_sms_render($message, $info) {

  // We need to apply filtering first or run through the render function
  $message = messaging_message_render($message, $info);

  // We can assume that we'll get max 110 characters for subject + body
  // Because from and data take up about 50 characters and total character limit
  // subject + from + date + body < 160
  $message->subject = messaging_sms_truncate($message->subject, 40);
  $message->body = messaging_sms_truncate($message->body, 110 - drupal_strlen($message->subject));
  return $message;
}