dotit / sarbacane-bundle
SarbacaneBundle 是为 sarbacane 定制的 Symfony 3.4 扩展包
V1.0
2020-06-10 12:24 UTC
Requires
- php: >=5.5.9
- doctrine/doctrine-bundle: ^1.6
- doctrine/orm: ^2.5
This package is auto-updated.
Last update: 2024-09-11 02:06:17 UTC
README
sarbacaneBundle 是为 sarbacane 定制的 Symfony 3.4 扩展包。
config.yml
在 config.yml 文件中使用此行。
sarbacane: apiKey: '%apiKey%' accountId: '%accountId%'
parameters.yml
apiKey: [YOUR_APIKEY] accountId: [YOUR_ACCOUNTID]
composer.json
"autoload": {
"psr-4": {
"DotIt\\SarbacaneBundle\\": "[bundle source]",
......
},
AppKernel.php
$bundles = [
.. ,
.. ,
new DotIt\SarbacaneBundle\SarbacaneBundle(),
];
命令
in terminal execute these command
$ composer dump-autoload
**** For update database table and add bundle new table *****
$ ./bin/console doctrine:schema:update --force
用法
/**** Create email new campaign *******/
$campaign = new Campaign();
$campaign->name='New Campaign';
$campaign->aliasFrom='Sender';
$campaign->subject='Object';
$campaign->emailFrom='examole@example.com';
$campaign->aliasReplyTo='sender';
$campaign->emailReplyTo='example@example.com';
$campaignID = CampaignManager::createCampaign($campaign);
/******ADD RECIPIENTS TO A CAMPAIGN*****/
$recipients =array(
array('email' => 'recipient1.@example.com','phone' => '216xxxxxxxx'),
array('email' => 'recipient2@example.com','phone' => '2162xxxxxxx')
);
CampaignManager::campaignSetRecipients($campaignID,$recipients);
/******* SEND CAMPAIGN ********************/
CampaignManager::sendCampaign($campaignID);
/***** GET CAMPAIGNS *********************/
//$ limit and offset can be null
$campaigns = CampaignManager::getCampaigns($limit, $offset);
/********* SET A LIST TO CAMPAIGN ********/
CampaignManager::campaignSetList($campaignID,$listID);
/********* SET A MODEL TO CAMPAIGN ********/
CampaignManager::campaignSetModel($campagnID,$modelID);
/***** CREATE NEW LIST ********/
$listID = ListManager::createList($name);
/****** ADD CONTACTS TO LIST *******/
$contacts= array(
array('email' => 'contact1.@example.com','phone' => '216xxxxxxxx'),
array('email' => 'contact2@example.com','phone' => '2162xxxxxxx')
);
ListManager::addContacts($listID,$contacts);
/****** GET LIST ******************/
//$ limit and offset can be null
$lists = ListManager::getList($limit,$offset);
许可证
SarbacaneBundle 在 MIT 许可证下授权 - 有关详细信息,请参阅LICENSE文件