selligent
New release
Una simple biblioteca de PHP para ayudarlo a interactuar con la API individual y transmisión de Selligent.
<?php # example.php
require ' ./vendor/autoload.php ' ;
use Mediapart Selligent Connection ;
use Mediapart Selligent Transport ;
use Mediapart Selligent Properties ;
/* connect you to your Selligent API server */
$ connection = new Connection ();
$ client = $ connection -> open ([
' login ' => ' ***** ' ,
' password ' => ' ***** ' ,
' wsdl ' => ' http://emsecure/individual?wsdl ' ,
]);
/*
Example : Trigger the TESTGATE campaign to an user.
We will register the user first an then, we will trigger
the campaign with a custom message :
*/
try {
$ transport = new Transport ( $ client );
$ user = new Properties ();
$ user [ ' NAME ' ] = ' Foo Bar ' ;
$ user [ ' MAIL ' ] = ' [email protected] ' ;
$ userId = $ transport
-> setList ( $ config [ ' list ' ])
-> subscribe ( $ user )
;
$ inputData = new Properties ();
$ inputData [ ' MESSAGE ' ] = ' Lorem ipsum dolor sit amet conceptuem. ' ;
$ result = $ transport
-> setCampaign ( $ config [ ' campaign ' ])
-> triggerCampaign ( $ userId , $ inputData )
;
} catch ( Exception $ e ) {
echo ' something bad happens. ' ;
}Puede transmitir una campaña basada en HTML completo de la API.
Simplemente instale este paquete con el compositor.
composer require mediapart/selligentEjecución de pruebas fuera de la caja:
./vendor/bin/phpunit Sin establecer algunas variables de entorno, se omitirán algunas pruebas. Pruebas en TestSuite real por ejemplo.