selligent
New release
ห้องสมุด PHP ง่าย ๆ ที่จะช่วยให้คุณโต้ตอบกับทั้ง API รายบุคคลและ API ออกอากาศ
<?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. ' ;
}คุณสามารถออกอากาศแคมเปญตาม HTML ที่สมบูรณ์จาก API
เพียงติดตั้งแพ็คเกจนี้ด้วยนักแต่งเพลง
composer require mediapart/selligentดำเนินการทดสอบนอกกรอบ:
./vendor/bin/phpunit หากไม่มีการตั้งค่าตัวแปรสภาพแวดล้อมบางอย่างการทดสอบบางอย่างจะถูกข้าม การทดสอบในการทดสอบ real เช่น