selligent
New release
مكتبة PHP بسيطة لمساعدتك في التفاعل مع كل من 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. ' ;
}يمكنك بث الحملة بناءً على HTML الكامل من API.
ما عليك سوى تثبيت هذه الحزمة مع الملحن.
composer require mediapart/selligentتنفيذ الاختبارات خارج الصندوق:
./vendor/bin/phpunit دون تحديد بعض متغيرات البيئة ، سيتم تخطي بعض الاختبارات. اختبارات في اختبار real على سبيل المثال.