The easiest way to provide bulk email services in your applications.
YiiSES is a 'nearly' ready to use module that provides our Yii applications with a powerful mail marketing tool.
The system makes use of Amazon Simple Email Service (Amazon SES), chosen for its highly reduced price, scalability and features. A developer can easily register and use its service at no charge. The only issue is that the developer will only be able to send to verified email addresses only.
This module has been ported to Open Source from one of the projects at Clevertech and we are very happy with its results so far.
Even though there was some good effort to make it easy to install, its configuration is a bit tricky. We hope this will change with a bit of help from the community.
Within the code you will find two types of configurations, one to be used with YiiBoilerplate project structure (default), and the other when we install the module on a Yii's default application structure.
The following instructions are to install the module on a Yii's default application structure.
Create your web application ./yiic webapp <folder>
Create your modules folder under protected and unpack the module there
Place commands\CampaignCommand.php on your commands directory and ses\migrations.. on the migrations directory.
Configure your config\main.php and config\console.php configuration files (make sure your db is setup correctly -migrations will only work on mySQL db):
// console.php
…
// urlManager must be the same configuration as on main.php
'urlManager' => array(
// remember to have your .htaccess setup correctly
'urlFormat' => 'path',
'showScriptName' => false,
'urlSuffix' => '/',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
// request is required to create appropriate urls within the emails
// when processed with the CampaignCommand.php
'request' => array(
)
…
// main.php
…
'modules' => array(
'ses'=>array(
'password'=>'clevertech',
),
),
…
// urlManager must be the same configuration as on main.php
'urlManager' => array(
// remember to have your .htaccess setup correctly
'urlFormat' => 'path',
'showScriptName' => false,
'urlSuffix' => '/',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
…
'params'=> array(
'ses.aws.key'=>'',
…
...
Setup required parameters on your configuration files (must be shared among console.php and main.php):
Make sure your paths are correctly set:
Run migrations ./yiic migrate
from your command line prompt.
One important part of the configuration is how you deal with the subscribers. The module works by default with the assumptions that your application has a User model with id, email, and username, subscribed attributes.
The module comes with a single field for campaign that configures whether to send to subscribers or not but you can easily change that behavior to match different fields or subscription option from your registered members -but this is something that I won't explain here :).
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
====
well-built beautifully designed web applications
www.clevertech.biz