The SendMessageNL method:
Parameters listGuid e listId can be used together or alternatively, passing one of them as null or empty: in the first case the list is verified using both parameters, otherwise using only the provided parameter.
SendMessageNL method
|
SendMessageNL is often the best option for a fast bulk import and sending but users should be aware of some known limitations |
The method returns
Since SendMessageNL starts an asynchronous task, in some cases a failure may occur after the method call is completed. In this case the failure is notified by means of an alert
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:ws="http://services.mailupnet.it/WS"> <soap:Header/> <soap:Body> <ws:SendMessageNL> <ws:accessKey>HzAgwRRJaAKBtkgNWpkAuURfV4SxMm6T3HJegRuSkUivKJElNNcmSQe8nqGyoM9</ws:accessKey> <ws:fileName>10_201105031527211234.csv</ws:fileName> <ws:separator>;</ws:separator> <ws:listId>10</ws:listId> <ws:listGuid>0e591119-cd77-4157-9379-6ac75335664</ws:listGuid> <ws:messageId>151</ws:messageId> <ws:senderName>Your Dealer</ws:senderName> <ws:sender>sender@example.com</ws:sender> <ws:subject></ws:subject> <!-- +02:00 is the shift due to time zone setting. If not specified, the time zone of Italy will be used --> <!-- Please take into account note that time shift changes during Daylight saving time (e.g. during summer its value for Italy is +02:00 instead of +01:00) --> <ws:timeDateSending>2013-05-22T13:00:00.000+02:00</ws:timeDateSending> </ws:SendMessageNL> </soap:Body> </soap:Envelope> |
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <SendMessageNLResponse xmlns="http://services.mailupnet.it/WS"> <SendMessageNLResult>226</SendMessageNLResult> </SendMessageNLResponse> </soap:Body> </soap:Envelope> |
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <SendMessageNLResponse xmlns="http://services.mailupnet.it/WS"> <SendMessageNLResult>-1</SendMessageNLResult> </SendMessageNLResponse> </soap:Body> </soap:Envelope> |
<?php class MailUpWsSend { protected $WSDLUrl = "https://wsvc.ss.mailup.it/MailupSend.asmx?WSDL"; //... public function loginFromId() { //... } public function logout() { //... } public function sendMessageNL($params) { try { $params = array_merge((array)$params, array("accessKey" => $this->accessKey)); $this->soapClient->sendMessageNL($params); } catch (SoapFault $soapFault) { var_dump($soapFault); } } } $WsSend = new MailUpWsSend(); $WsSend->loginFromId(); $filename = "10_201105031527211234.csv" uploadFile($filename) or die("Unable to upload list of recipients through FTP"); $sendingDate = date ("c", mktime(13,20,0,7,1,2013)); //set date with 2013-07-01T13:20:00+00:00 $sendMessageNLData = array("fileName" => $filename, "separator" => ";", "listId" => "10", "listGuid" => "0e591119-cd77-4157-9379-6ac75335664", "messageId" => "151", "senderName" => "Your Dealer", "sender" => "sender@example.com", "subject" => "", "timeDateSending" => $sendingDate ); $WsSend->sendMessageNL($sendMessageNLData); $WsSend->logout(); ?> |