Curent used function:
function tep_mandrill_mail($to_name, $to_email_address, $email_subject, $email_text, $from_email_name, $from_email_address) {
if (SEND_EMAILS != 'true') return false;
$uri = 'https://mandrillapp.com/api/1.0/messages/send-template.json';
$postString = '{
"key": "xxxxxxxxxxx",
"template_name": "sometemplatename",
"template_content": [
{
"name": "header",
"content": "*|HEADERSTUFF|*"
},
{
"name": "main",
"content": "*|CONTENTSTUFF|*"
},
{
"name": "footer",
"content": "*|FOOTERSTUFF|*"
}
],
"message": {
"subject": "'.$email_subject.'",
"from_email": "'.$from_email_adress.'",
"from_name": "'.$from_email_name.'",
"to": [
{
"email": "'.$to_email_address.'",
"name": "'.$to_name.'"
}
],
"important": false,
"track_opens": true,
"merge": true,
"merge_vars": [
{
"rcpt": "'.$to_email_address.'",
"vars": [
{
"name": "HEADERSTUFF",
"content": "'.$email_subject.'"
},
{
"name": "CONTENTSTUFF",
"content": "'.$email_text.'"
},
{
"name": "FOOTERSTUFF",
"content": "paulvale-foot"
}
]
}
],
"tags": [
"password_forgotten"
]
},
"async": false,
"ip_pool": "Main Pool"
}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
curl_exec($ch);
}