Mailspy
ESP agnostic sending and tracking platform for email campaigns
Requirements
Mongodb > 1.8
Setup
Add gem “mailspy” to your Gemfile
gem "mailspy"
If you haven’t already create a mongoid.yml file for the mongodb connection
rails generate mongoid:config
Create the mongoid configuration for the mongo db
rails g mail_spy:initializer
Fill out the generated mailspy.rb with your esp settings (file has example) and AWS settings
Then mount the engine in the routes.rb file
Rails.application.routes.draw do
mount MailSpy::Engine => "/mail_spy"
end
Usage
Mailspy is centered around email templates and instances of those templates (aka emails).
To create a template: add a template to your s3 directory, campaign/stream/component.(text|html).erb
To create a instance:
MailSpy.create_email(options)
required options include:
* :template_name
* :campaign :top level grouping
* :stream : mid level grouping
* :component : bottom level grouping
* :schedule_at
* :subject
* :template_values
* :from
* :reply_to
* one of [:to, :cc, :bcc]
Testing
You will need to add your own mongoid.yml to the dummy app, rake db:create, and rake db:migrate and rake db:test:prepare to get the dummy app setup.
Then you can simply run rake from the plugins test directory
TODO explain the test_email_credentials.yml file in /test
License
This project rocks and uses MIT-LICENSE.