protected function execute($arguments = array(), $options = array()) { $this->logSection('--', 'register api' ); ProjectConfiguration::registerMandrillAPI(); $mandrill = new Mandrill( MANDRILL_API_KEY ); $this->logSection('--', 'send test' ); $message = array( 'subject' => 'Test message', 'from_email' => '*****@*****.**', 'html' => '<p>Hi *|FIRSTNAME|*</p> Everything allright in the *|LASTNAME|* family?</p><p>This is a test message with Mandrill\'s PHP wrapper :-)</p> <P>Sent to: *|EMAIL|*</p>', 'to' => array( array('email' => '*****@*****.**', 'name' => 'Roman'), array('email' => '*****@*****.**' ) ), 'preserve_recipients' => false, # do not expose all recipients in -to- header 'merge_vars' => array( array( 'rcpt' => '*****@*****.**', 'vars' => array( array( 'name' => 'EMAIL', 'content' => '*****@*****.**'), array( 'name' => 'FIRSTNAME', 'content' => 'Roman'), array( 'name' => 'LASTNAME', 'content' => 'Kallweit') )), array( 'rcpt' => '*****@*****.**', 'vars' => array( array( 'name' => 'EMAIL', 'content' => '*****@*****.**'), array( 'name' => 'FIRSTNAME', 'content' => 'Topo'), array( 'name' => 'LASTNAME', 'content' => 'Lino') )) )); $template_name = 'downtown_test'; $template_content = array( array( 'name' => 'preheader_content', 'content' => 'just another mandrill-test' ), array( 'name' => 'body_content', 'content' => '<p>Hi *|FIRSTNAME|*</p> Everything allright in the *|LASTNAME|* family?</p><p>This is a test message with Mandrill\'s PHP wrapper :-)</p> <P>Sent to: *|EMAIL|*</p>' ), array( 'name' => 'footer', 'content' => 'Copyright 2012.') ); print_r($mandrill->messages->sendTemplate($template_name, $template_content, $message)); // print_r( $mandrill->messages->send($message, )); $this->logSection('--', 'DONE' ); }