public function MandrillMailSystem::format in Mandrill 7.2
Same name and namespace in other branches
- 6 mandrill.mail.inc \MandrillMailSystem::format()
- 7 lib/mandrill.mail.inc \MandrillMailSystem::format()
Concatenate and wrap the email body for either plain-text or HTML emails.
Parameters
array $message: A message array, as described in hook_mail_alter().
Return value
array The formatted $message.
Overrides MailSystemInterface::format
1 method overrides MandrillMailSystem::format()
- MandrillHtmlMailSystem::format in lib/
mandrill.mail.inc - Concatenate and wrap the email body for either plain-text or HTML emails.
File
- lib/
mandrill.mail.inc, line 22 - Implements Mandrill as a Drupal MailSystemInterface
Class
- MandrillMailSystem
- Modify the drupal mail system to use Mandrill when sending emails.
Code
public function format(array $message) {
// Join the body array into one string.
if (is_array($message['body'])) {
$message['body'] = implode("\n\n", $message['body']);
}
// Apply input format to body.
$format = variable_get('mandrill_filter_format', '');
if (!empty($format)) {
$message['body'] = check_markup($message['body'], $format);
}
return $message;
}