selligent
New release
Selligent 개인 및 방송 API와 상호 작용하는 데 도움이되는 간단한 PHP 라이브러리.
<?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. ' ;
}API의 완전한 HTML을 기반으로 캠페인을 방송 할 수 있습니다.
작곡가 로이 패키지를 설치하기 만하면됩니다.
composer require mediapart/selligent상자 밖에서 테스트 실행 :
./vendor/bin/phpunit 일부 환경 변수를 설정하지 않으면 일부 테스트가 건너 뜁니다. 예를 들어 real 테스트 수양의 테스트.