I'm trying to use the Streamsend API Blast... using create method ... I just followed the API Documentation on how to send a request... but I guess there's something wrong here I've done :
$this->optHTTPHEADER(0,'');
$this ->optINCHEADER(true);
$this->setOPT("/audiences/1/blasts.xml","POST");
extract($vars);
if($shed_type == "now"){
$datesched = gmdate("Y-m-d\Th:i:s\Z",time());
}else{
$datesched = $schedule;
}
$xml = "<blast>
<from>
<name>Customer Service</name>
<email-address>{$from}</email-address>
</from>
<to>
<audience-id>1</audience-id>
<include-lists>{$list_id}</include-lists>
</to>
<subject>{$subject}</subject>
<body>
[<html-part><![CDATA[ {$body} ]]></html-part>]
</body>
<options>
<track-views>true</track-views>
<track-clicks>true</track-clicks>
<include-social-bar>false</include-social-bar>
</options>
<scheduled-for>{$datesched}</scheduled-for>
</blast>";
$this->optPOSTFIELDS($xml);
$this->optRETURNTRANS();
if($this->error()){
$msg = $this->error();
}else{
$msg = $this->execute();
}
return $msg;
}
Please, I really have to get this work... your answer will be much appreciated.