Skip to content

Add the message

By Mounir 1 min read

Add / edit the message of a campaign (not yet sent).

array Modif_Message_Campagne( id_campagne, login, motdepasse, url)

Description

Integrate a message into a campaign. The message is fetched from a URL provided as an argument.

Warning: the message source must be valid (head and body tags, plus style tags if applicable).

Parameters (required)

login: customer ID (nichandle)

motdepasse: the password

id_campagne: the campaign identifier

url: the URL.

Return value

true (1)

Error messages

No field must be left empty login

No field must be left empty motdepasse

No field must be left empty url

Campaign already sent

This campaign does not appear to belong to you

Example with NuSOAP

The following example sets the message of a campaign:

include('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'=>'http://www.eml-srv.com/view.html?id=3227' );

$variable=$client->call('Modif_Message_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->Modif_Message_Campagne('21','your_login','your_password','url'=>'http://www.eml-srv.com/view.html?id=3227'); //or //$variable = $client->__soapCall(Modif_Message_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