You are here

function mandrill_template_sender in Mandrill 7

Same name and namespace in other branches
  1. 7.2 modules/mandrill_template/mandrill_template.module \mandrill_template_sender()

Send a templated Mandrill message.

This function checks for appropriate settings in the message, then uses the template API call to send the message if the settings are valid.

Parameters

array $message: Mandrill message to send.

string $template_id: Name of the template to use.

array $template_content: Associative array mapping template regions and content.

Return value

array Message response.

Throws

MandrillException

1 string reference to 'mandrill_template_sender'
mandrill_template_mandrill_mail_alter in modules/mandrill_template/mandrill_template.module
Implements hook_mandrill_mail_alter().

File

modules/mandrill_template/mandrill_template.module, line 189
Enables Drupal to send email using Mandrill's template system.

Code

function mandrill_template_sender($message, $template_id, $template_content) {
  if ($mailer = mandrill_get_api_object()) {
    return $mailer
      ->messages_send_template($template_id, $template_content, $message);
  }
  return NULL;
}