Mandrill API への cURL 呼び出しをフォーマットする方法がよくわかりません...
$specific_api = "/messages/send.json";
$url = "https://mandrillapp.com/api/1.0/" . specific_api . "?";
$param_array = array(
'key' => $apikey,
'template_name' => 'mytemplate',
'template_content' => array(
'name' => 'main',
'content' => 'This is HAPPENING RIGHT NOW!'
),
'message' => array(
'subject' => 'blanketID Service: Pet Found',
'from_email' => 'no-reply@blanketid.com',
'from_name' => 'blanketID Service',
'to' => array(
'email' => 'devinmightbe@gmail.com',
'name' => 'Devin Columbus'
)
)
);
$encoded = json_encode($param_array);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $encoded);
$data = curl_exec($ch);
curl_close($ch);
$arr = json_decode($data, true);
echo $data;
これがすべて正しくセットアップされているかどうかは本当にわかりません...