selligent
New release
Uma biblioteca PHP simples para ajudá -lo a interagir com a API individual e de transmissão vendedora.
<?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. ' ;
}Você pode transmitir a campanha com base em HTML completo da API.
Basta instalar este pacote com o Composer.
composer require mediapart/selligentExecutando os testes fora da caixa:
./vendor/bin/phpunit Sem definir algumas variáveis de ambiente, alguns testes serão ignorados. Testes em testsuite real por exemplo.