Add an email to a scenario defined in the MDWorks interface.

array Send_Mail_Scenario_API ( login, password, scenario, email, name, surname, p1, p2, p3, p4, p5, p6)

Description

Identification on MDWorks by login and password.

Selection of a campaign managed by the API.

Insertion of a line (recipient + personalization variables if applicable).

Launch of the countdown for the realization of the scenario.

Settings (required)

login : the client identifier

password : the password

scenario : scenario identifier

email : email address

name, surname, p1, p2, p3, p4, p5, p6 : additional data, available for personalization

Back

Returns an array containing the error message or an integer containing the recipient's ID (useful for tracking)

Error messages

No field should be left empty

No field should be left empty password

The scenario does not exist, does not belong to you

No field should be left empty

Intermediate error (wrong login / password)

Wrong email address

Unsubscribed email address (present in your blacklist)

Example with NuSOAP

include('nusoap/nusoap.php');

$client = new soapclient('https://www.eml-srv.com/_soap/control.php'); // Enlever le 's' de 'https' si CURL n'est pas installé

$parametres = array( 'login'=>'votre_login', 'motdepasse'=>'votre_mot_de_passe', 'scenario'=>'identifiant_scenario', 'email'=>'adresse_email', 'nom'=>'variable_nom', 'prenom'=>'variable_prenom', 'p1'=>'variable_p1', 'p2'=>'variable_p2', 'p3'=>'variable_p3', 'p4'=>'variable_p4', 'p5'=>'variable_p5', 'p6'=>'variable_p6' );

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

// Récupérer l'erreur le cas échéant if($client->fault) die("Erreur:Code: {$client->faultcode}
" . "Détail: {$client->faultactor}
" . "Solution: {$client->faultstring}
");

print_r($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->Envoi_Mail_Scenario_API('votre_login','votre_mot_de_passe','21','test@ediware.net','Bresler','Loïc','var1','var2','var3','var4','var5','var6'); //ou //$variable = $client->__soapCall(Envoi_Mail_Scenario_API,$parametres);

print_r($variable); } catch (SoapFault $fault) {
trigger_error("SOAP Fault: (faultcode: {$fault->faultcode}, faultstring: {$fault->faultstring})", E_USER_ERROR);

} 

This post is also available in: Français (French)