Mandrails - The Mandrill/ActionMailer connector

A delivery method implementation which uses the Mandrill REST API. This allows to simply send e-mails from a Rails app using Mandrill instead of SMTP or sendmail.

Open items

Currently this gem is in alpha quality, things we are still working:

  • [ ] Support for custom X- headers
  • [ ] Ability to override Mandrill settings, e.g. click tracking, per mail
  • [x] Improve test cases
  • [x] Implement Railtie which automatically hooks delivery method into AM
  • [x] Attachment support

Installation

Add mandrails to your Gemfile and run bundle afterwards:

    gem 'mandrails'

Usage

When using with Rails it's basically all setup to use the :mandrill delivery handler in config/environemnts/*.rb:

  config.action_mailer.delivery_method = :mandrill
  config.action_mailer.mandrill_settings = {
    key: "123...-abcde", # or set the MANDRILL_APIKEY environment variable
    from_name: "My Application",
    from_email: "[email protected]"
  }

Basically the :key and :from_email are required attributes, the :key can be omitted if the MANDRILL_APIKEY environment variable is set.

Additional information

Mailchimp & Mandrill

Thanks to the team at Mailchimp which provides the mandrill-api gem and of course the Mandrill service itself. FYI - the maintainers of this gem are in no way affiliated with Mailchimp or Mandrill.

License

MIT License. Copyright 2013 at-point ag. http://at-point.ch