joaohornburg / mailcannon-outpost

MailCannon wrapper ready to be deployed to the front line.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MailCannon Outpost

Use this wrapper to deploy your MailCannon workers to the war.

This is a work in PROGRESS, use it at your own risk

Install

Refer to the main gem for more details.

Download (or Clone/Fork) this repo, modify env.sh to meet your own variables and run it:

  $ git clone git@github.com:lucasmartins/mailcannon-outpost.git
  $ cd mailcannon-outpost
  $ . ./env.sample.sh # this will create an env.sh file.
  $ vim env.sh
  $ . ./env.sh

You should be able to run the wrapper like this:

  $ be sidekiq -r ./runner.rb --config=config/sidekiq.yml -v

You can access a console with MailCannon environment loaded like this:

  $ irb -r ./runner.rb

or like this on Heroku:

  $ heroku run 'bundle exec irb -r ./runner.rb'

MailCannon Outpost will use your MONGOBD_URL, take a look at your config/mongoid.yml file.

Use

Create a MailCannon::Envelope:

envelope = MailCannon::Envelope.create(
  from: 'test@mailcannon.com',
  to: [{email: 'lucasmartins@railsnapraia.com', name: 'Lucas Martins'}],
  subject: 'Test',
  mail: MailCannon::Mail.new(text: 'you will see this when no HTML reader is available', html: 'this should be an HTML'))

Caveats

MongoDB isn't an ACID database, you should be aware of MongoDB fundamentals (read the docs!) to put any app into production.

So depending on your setup, you may want to use synced operations to write your Envelopes to the database:

envelope = MailCannon::Envelope.with(safe: {j: true}).create(...)

Also, depending on your load, you may want to increase the waiting_time variable in your config/mailcannon.yml file to match your fsync cycle.

Contribute

Just fork MailCannon Outpost, add your feature/fix+spec, and make a pull request.

NOTICE: The project is at embrionary stage, breaking changes will apply.

Support

This is an opensource project so don't expect premium support, but don't be shy, post any troubles you're having in the Issues page and we'll do what we can to help.

License

MailCannon is free software under the FreeBSD license.

About

MailCannon wrapper ready to be deployed to the front line.


Languages

Language:Ruby 74.1%Language:Shell 25.9%