Versions Compared

Key

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

Method parameters

The SendMessageNL method allows to:

  1. Allows to send a message to the recipients listed in a CSV file
  2. Synchronously executes the following steps:

    1. Scheduling of a sending at the date and time contained in the parameters
    2. Return of a delivery ID to the caller

  3. Asynchronously executes the following steps:

    1. Creation of a group in MailUp in which to gather the recipients that have to be imported
    2. Import to MailUp of the recipients included in the file. Recipients will be imported to the list indicated by the filename (see appendix B for see details)

...

Method parameters

  • int SendMessageNL(string accessKey, string fileName, string separator, string listId, string listGuid, string messageId, string senderName, string sender, string subject, DateTime timeDateSending, int int sendDelayTest)
    • accessKey: access key obtained using the 
    Login Nome del file CSV che descrive gli Utenti cui sarà inviato il Messaggio.
  • separator: carattere separatore utilizzato nel file CSV. Se vuoto o nullo sarà utilizzato di default ';' come separatore.
  • listId: : Identificativo numerico che individua univocamente una Lista di MailUp.
  • listGuid: GUID che individua univocamente una Lista di MailUp.
  • messageId: Identificativo numerico del messaggio che si vuole inviare.
  • senderName: Nome del mittente del Messaggio.

Se non valorizzato (null o stringa vuota), MailUp utilizzerà il nome di default definito per la Lista indicata.

  • sender: indirizzo email del mittente del Messaggio.

Se non valorizzato (null o stringa vuota), MailUp utilizzerà l'indirizzo di default definito per la Lista indicata. Se nessun mittente di default è definito per tale Lista non effettua l'invio.

  • subject: Soggetto del messaggio da inviare.
  • timeDateSending: Data e ora cui programmare l'invio.
  • sendDelayTest: Ritardo desiderato per l'invio immediato espresso in minuti.

...

  • Nel primo caso la lista è verificata utilizzando entrambi i parametri.
  • Nel secondo caso utilizzando il parametro fornito.

 

Image Removed

Il metodo SendMessageNL

  • Richiede che il file dei contatti da importare sia depositato sui server di MailUp
  • Gestisce importazione ed invio per una lista specifica Diversamente dalle importazioni batch FTP da CSV, in questo caso non è possibile importare i contatti su liste diverse. Tutti i contatti del file sono da importare nella stessa lista.
  • Usa un file dei contatti deve essere scritto in formato CSV (ed opzionalmente compresso in formato ZIP). Il contenuto dei campi del file deve seguire le linee guida descritte in Appendice B
  • Non è in grado di eseguire verifiche sull'eventuale duplicazione di alcuni contatti all'interno del file (tale verifica è quindi in carico al sistema del cliente che crea il file)

...

  • Se data e ora hanno un valore che appartiene al passato l'invio è gestito come Invio Immediato. Il ritardo minimo prestabilito è calcolato in base al valore fornito dal parametro sendDelayTest:.
  • Se il valore di data/ora è successivo a quello attuale allora l'invio è gestito come Invio Schedulato Pianificato, programmato.

...

  • uguale o minore di zero. In questo caso il ritardo dell'Invio Immediato è un valore fisso definito in MailUp (Configurato in 20 minuti).
  • Maggiore di zero. In questo caso il ritardo dell'Invio Immediato corrisponde al valore del parametro.

...

timeDateSending

sendDelayTest

Data invio schedulata in MailUp

valore = MinValue Data e Ora o valore <= data attuale (Invio Immediato)

sendDelayTest > 0

data attuale + sendDelayTest

valore = MinValue Data e Ora o valore <= data attuale (Invio Immediato)

sendDelayTest <= 0

data attuale + Valore fisso definito in MailUp

valore > data attuale (Invio Schedulato)

sendDelayTest > 0

timeDateSending

valore > data attuale (Invio Schedulato)

sendDelayTest <= 0

timeDateSending

Tabella 7: Calcolo programmazione invio
Il metodo restituisce:

  • L'identificativo numerico dell'Invio.
  • -1 in caso l'operazione non può essere portata a buon fine (ad esempio parametri errati o problemi di sistema).
    • name of the CSV files containing the recipients of the message
    • separator: separating character used in the CSV file. If null or empty, the character ';' will be used by default.
    • listId: list identifier
    • listGuid: GUID of the list in MailUp
    • messageId: ID of the message to be sent
    • senderName: name of the sender of the message. If null or empty, the system will use the default name for the list.
    • sender: email address of message sender. If null or empty, the system will use the default address for the list. If no default sender has been defined for the list, the sending does not start.
    • subject: required but not used, you can either set it to NULL or empty string value
    • timeDateSending: date and time of scheduled sending
    • sendDelayTest: no more used, always set to zero.

Parameters listGuid 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.

 

Info

SendMessageNL method

  • Requires the CSV file to be moved to MailUp servers before method is called
  • Manages import and sending for a specific list. Differently from batch FTP imports from a CSV file, this method does not allow to import contacts to different lists. All recipients must be imported in the same list
  • The file containing the recipients must be in CSV format (can also be provided in a compressed format using ZIP compression).The file and its fields must be structured following the guidelines contained in the CSV file description

 

 

Note

SendMessageNL is likely the best option for a fast bulk import and sending but users should be aware of some known limitations

The method returns

  • the ID of the sending
  • -1 in case the operation did not complete successfully (e.g. due to incorrect parameters or system failure). In this case no recipient has been imported and no message has been sent. 
    You should then check:
    • if parameters fileName, messageId and accessKey have been provided.
    • if parameter accessKey is correct (it should contain the key obtained from login method).
    • that at least one of the parameters listId and ListGuid has been provided. And if their values are correct.
    • that the sender argument contains a valid email address or an empty string when provided.

  • -3 in case the request command to start import to MailUp of the recipients included in the file fail. (e.g. due to an import operation already running that the system doesn't recognize).

    If this is the case, you should login into your mailup account and check if the import process was successfully queued. If so, the dispatch will take place correctly, else, it would be required to run once again the SendMessageNL method.

Since SendMessageNL starts as 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 Examples

 

Sample request

Code Block
languagehtml/xml
titleSOAP request (Scheduled sending with time zone)
firstline1
linenumberstrue
<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>

 

Sample response

Code Block
languagehtml/xml
titleSOAP response (successful, returns sending ID)
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>226</SendMessageNLResult>
      </SendMessageNLResponse>
   </soap:Body>
</soap:Envelope>
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" => "",
						   "timeDateSending" => $sendingDate
);


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

?>

Related pages

Child pages (Children Display)