Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Permette la creazione di un messaggio e-mail all'interno della lista desiderata 

Allows the creation of an email message within the desired list.

Method parameters

  • string CreateNewsletter(string accessKey, int listID, string subject, string type, string content, Option[] options)
    • accessKey:

...

    •  access key obtained using the LoginFromId method
    • listID: ID of the list within which the newsletter has to be created. Lists and corresponding IDs can be obtained calling the GetLists Method
    • subject: subject of the email message
    • type: type of message text (HTML, URL, FILE, TEXT)
    • content:

...

    • message text source, depending on the type:
      • type = HTML, content
    è il codice HTML del messaggio
      • is the HTML code of the message
      • type = TEXT, content
    è il PLAIN-TEXT del messaggio
      • is the PLAIN-TEXT of the message (this value is deprecated and it is handled exactly as "HTML")
      • type = URL, content
    è l'url da quale ricavare in codice HTML del messaggio
      • is the url from which to draw the HTML code of the message
      • type = FILE, content
    è uno array di byte che rappresenta il file dal quale ricavare il codice HTML del messaggio
      • is a byte array from which to draw the HTML code of the message
    • options:

...

    • an array

...

    • of key/value

...

    • pairs for options setting
      • note:
    una stringa contenente delle note relative al messaggio
      • a string containing notes about the message
      • dyn_fld:
    una valore booleano per abilitare/disabilitare l'utilizzo dei campi dinamici all'interno del messaggio
      • boolean value to enable/disable the use of dynamic fields in the message (dyn_fld=true, dyn_fld=false)
      • emb_img:
    un valore booleano per abilitare/disabilitare l'utilizzo di immagini embedded all'interno del messaggio
      • boolean value to enable/disable the use of embedded images in the message (emb_img=true, emd_img=false)
      • link_track:
    una valore booleano per abilitare/disabilitare il tracciamento dei link
      •  boolean value to enable/disable the use of link tracking in the message (link_trcak=true, link_track=false).
    Se
      • If link_track=true
    e non viene specificato nessun'altra opzione si considera abilitato il tracciamento di tutti i protocolli
      • and no other option is specified all the protocols are activated.
      • track_http:
    una valore booleano per abilitare/disabilitare il tracciamento del protocollo http
      • boolean value to enable/disable the use of http protocol tracking in the message (track_http=true, track_http=false)
      • track_https:
    una valore booleano per abilitare/disabilitare il tracciamento del protocollo HTTPS
      • boolean value to enable/disable the use of HTTPS protocol tracking in the message (track_https=true, track_https=false)
      • track_mailto:
    una valore booleano per abilitare/disabilitare il tracciamento del protocollo MAILTO
      • boolean value to enable/disable the use of MAILTO protocol tracking in the message (track_mailto=true, track_mailto=false)
      • track_ftp:
    una valore booleano per abilitare/disabilitare il tracciamento del protocollo FTP
      • boolean value to enable/disable the use of FTP protocol tracking in the message (track_ftp=true, track_ftp=false)
      • track_news:
    una valore booleano per abilitare/disabilitare il tracciamento del protocollo NEWS
      • boolean value to enable/disable the use of NEWS protocol tracking in the message (track_news=true, track_news=false)
      • link_params:
    una stringa che permette di specificare dei parametri aggiuntivi per i link tracciati
      • a string allowing to specify additional parameters for tracked links
      • body_code:
    una stringa che contiene un codice personalizzato del TAG <body>
  • header: una stringa che contiene un codice personalizzato del TAG <header>
  • conf_msg: un valore booleano per marcare la newsletter come messaggio di conferma iscrizione.
      • a string containing a personalized code for the <body> tag
      • header: a string containing a personalized code for the <header> tag
      • conf_msg: boolean value to mark the message used as a subscription confirmation
      • attach<nn>_data = base64 file encoding
    del file
      • attach<nn>_name =
    nome del file
      • filename
      • template =
    identificativo del template da utilizzare per la creazione della newsletter. In caso venga specificata le opzioni "template"
      • ID of the template to be used for newsletter creation. In case the "template" parameter is specified, "body_code"
    e il parametro
      • and "content"
    e non vengono presi in considerazione.

...

      • parameters will be ignored.

If error code=0, the message will contain the ID of the newsletter which has been created

SOAP Examples

Code Block
languagehtml/xml
titleSOAP Request
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:CreateNewsletter>  
          <ws:accessKey>HzAgwRRJaAKBtkgNWpkAuURfV4SxMm6T3HJegRuSkUivKJElNNcmSQe8nqGyoM9S8EyQZb6ZE2shjHWIN4f5xYBJx9uda/Mo</ws:accessKey>
          <ws:listID>1</ws:listID>
          <!-- use campoNN (where NN goes from 1 to 39) and set dyn_fld=true to insert dynamic fields in the subject -->
          <ws:subject>This is a new html newsletter for [campo1]</ws:subject>
          <ws:type>HTML</ws:type>
          <!-- use campoNN (where NN goes from 1 to 39) and set dyn_fld=true to insert dynamic fields inside message body -->
          <ws:content>hello [campo1] [campo2]&lt;/br >&lt;/br > lorem ipsum dolor sit amet, consectetur adipiscing elit. </ws:content>
          <ws:options>
             <ws:Option><ws:Key>dyn_fld</ws:Key><ws:Value>true</ws:Value></ws:Option>
             <ws:Option><ws:Key>note</ws:Key><ws:Value>testing html message</ws:Value></ws:Option>

             
             <!--you can add one or more attachments: do not specify "CDATA" for encoded data-->
             <ws:Option><ws:Key>attach01_data</ws:Key><ws:Value>llPxu+vqfw/+R/As7 ... kVRRmrwTMgAAAABJRU5ErkJggg==</ws:Value></ws:Option>
             <ws:Option><ws:Key>attach01_name</ws:Key><ws:Value>myfile.png</ws:Value></ws:Option>
          </ws:options>
       </ws:CreateNewsletter>
    </soap:Body>
 </soap:Envelope>
Code Block
languagehtml/xml
titleSOAP Response
linenumberstrue
<CreateNewsletterResult>
<errorCode>0</errorCode>
<errorDescription></errorDescription>
<listID>1</listID>
<newsletterID>3</newsletterID>
</CreateNewsletterResult>

Code Examples

Code Block
languageruby
titleRuby
# Refer to https://mailup.atlassian.net/wiki/display/mailupapi/MailUp+RubyGem for gem information.
require 'mailup'
m = MailUp::Send.new('username', 'password')
m.get_create_newsletter(:listId => 1, :subject => "Sample Subject", :type => 'HTML', :content => "HTML Content...", "Options" => {...})
# => <CreateNewsletterResult><errorCode>0</errorCode><errorDescription></errorDescription><listID>1</listID><newsletterID>3</newsletterID></CreateNewsletterResult>"
Code Block
languagephp
titlePHP
class MailUpWsSend {

protected $WSDLUrl = "https://wsvc.ss.mailup.it/MailupSend.asmx?WSDL";
private $soapClient;
private $xmlResponse;
protected $domResult;

function __construct() {
	$this->soapClient = new SoapClient($this->WSDLUrl,
	array("trace" => 1,
	"exceptions" => 0));
}

function __destruct() {
unset($this->soapClient); 
}

public function loginFromId($loginData) {
	try {
		$this->soapClient->loginFromId($loginData);
		if ($this->readReturnCode("LoginFromId","errorCode") != 0) {
			echo "<br /><br />LoginFromId Error: ". $this->readReturnCode("LoginFromId","errorDescription");
			die();
	}
	else $this->accessKey = $this->readReturnCode("LoginFromId","accessKey");
	} catch (SoapFault $soapFault) { 
		var_dump($soapFault);
}
}

public function createNewsletter($params) {
	try {
		$params = array_merge((array)$params, array("accessKey" => $this->accessKey));
		$this->soapClient->createNewsletter($params);
		if ($this->readReturnCode("CreateNewsletter","errorCode") != 0) 
			echo "<br /><br />CreateNewsletter Error: ". $this->readReturnCode("CreateNewsletter","errorCode") ." - " . $this->readReturnCode("CreateNewsletter","errorDescription");
	} catch (SoapFault $soapFault) { 
		var_dump($soapFault);
	}
}

private function readReturnCode($func, $param) {
	$this->xmlResponse = $this->soapClient->__getLastResponse();
	$dom = new DomDocument();
	$dom->loadXML($this->xmlResponse) or die("File XML non valido!");
	$xmlResult = $dom->getElementsByTagName($func."Result");
	$this->domResult = new DomDocument();
	$this->domResult->LoadXML(html_entity_decode($xmlResult->item(0)->nodeValue)) or die("File XML1 non valido!");;
	$rCode = $this->domResult->getElementsByTagName($param);
	return $rCode->item(0)->nodeValue;
}

public function option($key, $value) {
	return array("Key" => $key, "Value" => $value);
}

}
 

// for more info about login process please refer to http://help.mailup.com/display/mailupapi/WebService+MailUpSend
$loginData = array("user" => "YOUR_CONSOLE_USERNAME","pwd" => "YOUR_CONSOLE_PASSWORD","consoleId" => "YOUR_CONSOLE_ID");
$WsSend = new MailUpWsSend();
$WsSend->loginFromId($loginData); 
$newsLetterData = array("listID" => "1",
            "subject" => "this is my subject",
            "type" => "HTML",
            "content" => "Hello world, this is message body",
            "options" => array($WsSend->option("note","additional notes"),
                $WsSend->option("dyn_fld", true),
                $WsSend->option("link_track", true),
                //... other options
                )
            );
$WsSend->createNewsletter($newsLetterData);


.NET

If you're using a language that is based on .Net framework please check this page