/** * Send a new transactional message through Mandrill using a template. * * @param string $templateName the immutable name or slug of a template that exists in the user's account * @param Message $message * @param array $templateContent array(array('name' => 'example_name', 'content' => 'example_content')) * @param bool $async set to true to enable asynchronous sending * @param string $ipPool optional name of the ip pool which should be used to send the message * @param string $sendAt optional UTC timestamp (YYY-MM-DD HH:MM:SS) at which the message should be sent * * @return array * * @link https://mandrillapp.com/api/docs/messages.JSON.html#method=send-template */ public function sendTemplate($templateName, Message $message, array $templateContent = [], $async = false, $ipPool = null, $sendAt = null) { if (!count($templateContent)) { $templateContent = ['']; // Mandrill will not accept an empty array for template_content, but it does not require any actual content. } return $this->request('send-template', ['template_name' => $templateName, 'template_content' => $templateContent, 'message' => $message->toArray(), 'async' => $async, 'ip_pool' => $ipPool, 'send_at' => $sendAt]); }