You can send an email and use the template using the Mandrill PHP API wrapper.
require 'Mandrill.php'; $mandrill = new Mandrill('YOUR_API_KEY'); $message = array( 'subject' => 'My subject', 'from_email' => ' marc@example.com ', 'to' => array(array('email' => ' recipient1@example.com ', 'name' => 'Marc')), 'merge_vars' => array(array( 'rcpt' => ' recipient1@example.com ', 'vars' => array( array( 'name' => 'FIRSTNAME', 'content' => 'Recipient 1 first name'), array( 'name' => 'LASTNAME', 'content' => 'Last name') )))); $template_name = 'YOUR-TEMPLATE-NAME'; $template_content = array( array( 'name' => 'main', 'content' => 'Hi *|FIRSTNAME|* *|LASTNAME|*, thanks for signing up.'), array( 'name' => 'footer', 'content' => 'Copyright 2013.') ); $response = $mandrill->messages->sendTemplate($template_name, $template_content, $message); print_r($response);
If you want to use SMTP through SwiFtMailer, you can call the Render API to render the template, which will give you the full HTML code that you can pass to SwiftMailer, but this seems like a slightly long winding way to do this compared to the PHP API shell.
source share