Very excited to be asking my first question on StackOverflow. I\'ve been relying on it to teach myself quite a lot over the years!
My question is this. I am getting the
Have been experimenting with Dan's curl setup to post html enriched messages to Mandrill, but this time using html in the template_content: [] array of the message/send-template.json api.
What i noticed was that this setup (fix by Bansi included) seemed to work in Mandrill's try out page : https://mandrillapp.com/api/docs/messages.JSON.html#method=send-template
But in my php script, i kept receiving this stubborn You must specify a key value
error. Apparantly thanks to this thread, i solved the issue by adding utf8 as charset to the request headers:
$ch = curl_init();
$headers = array("Content-type: application/json;charset=\"utf-8\"");
curl_setopt($ch, CURLOPT_URL, $uri);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_HTTPHEADER,$headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
$result = curl_exec($ch);