dotit/sarbacane-bundle

SarbacaneBundle is a Symfony 3.4 bundle for sarbacane

V1.0 2020-06-10 12:24 UTC

This package is auto-updated.

Last update: 2024-09-11 02:06:17 UTC


README

sarbacaneBundle is a Symfony 3.4 bundle for sarbacane .

config.yml

Use this line in config.yml file.

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(),
        ];

Command

in terminal execute these command

$ composer dump-autoload

**** For update database table and add bundle new table *****  
$ ./bin/console doctrine:schema:update --force


Usage

/**** 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);

 

License

SarbacaneBundle is licensed under the MIT License - see the LICENSE file for details

company

DOTIT