Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagehtml/xml
titleSOAP response (request failed)
firstline1
linenumberstrue
<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>

 

 

Code Examples

Code Block
languagephp
titlePHP
firstline1
linenumberstrue
<?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" => "Best Offer of the week",
						   "timeDateSending" => $sendingDate
);


$WsSend->sendMessageNL($sendMessageNLData);
$WsSend->logout();

?>