Skip to content

Add addresses via URL

By Mounir 2 min read

Add addresses to the recipient list via a URL.

array Ajout_Destinataires_URL_Campagne( login, motdepasse, id_campagne, url)

Warning: to secure the URL you host that contains the addresses, we recommend:
- disabling robot indexing of the page and directory listing if applicable
- ideally restricting access to the URL to certain IPs (contact support to get the list)

Description

Add a row to the recipient list of a campaign.

Parameters (required)

login: customer ID (nichandle)

motdepasse: the password

id_campagne: the campaign identifier

url: the URL of an email list. The file returned by your URL must contain emails one per line. Additional columns, if any, must be separated by semicolons (CSV, semicolon, no quotes around fields).

Example:

$url='http://www.domain.com/my_email_file.csv';

Return value

true (1) or false (0)

Error messages

No field must be left empty login

No field must be left empty motdepasse

No field must be left empty url

Authentication error (invalid login / password)

This campaign does not appear to belong to you

Example with NuSOAP

The following example imports addresses into a campaign:

i nclude(’nusoap/nusoap.php’);

$client = new soapclient('https://www.eml-srv.com/_soap/control.php');   // Remove the 's' from https if CURL is not installed

$parametres = array(
	'login'=>'your_login',
	'motdepasse'=>'your_password',
	'id_campagne'=>'21',
	'url'=>$ligne
	);

$variable=$client->call('Ajout_Destinataires_URL_Campagne', $parametres);

// Retrieve the error, if any
if($client->fault)
die("Error:Code: {$client->faultcode}"
. "Detail: {$client->faultactor}"
. "Solution: {$client->faultstring}");

echo $variable;

Example with PHP5

try {
$client = new SoapClient(null, array('location' => "https://www.eml-srv.com/_soap/control.php",
                                      'uri'      => "https://www.eml-srv.com",
                                     'encoding'=>'ISO-8859-1'
                                     ));
$variable = $client->Ajout_Destinataires_URL_Campagne('your_login','your_password','21',$url);
//or
//$variable = $client->__soapCall(Ajout_Destinataires_URL_Campagne,$parametres);
//$variable=unserialize(rawurldecode($variable));
print_r($variable);
} catch (SoapFault $fault) {
    trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);
}
Last updated on