0.0
No commit activity in last 3 years
No release in over 3 years
A Mad Mimi delivery method for the Ruby Mail library, with Rails 3 support.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.6

Runtime

~> 1.0.15
~> 2.2
 Project Readme

Mail::MadMimi

Mail::MadMimi is a delivery method for Mail. It uses the MadMimi library to send mail via Mad Mimi.

Installation

Add to your Gemfile:

gem "mail-mad_mimi", :require => "mail/mad_mimi"

Usage

require "mail"
require "mail/mad_mimi"

mail = Mail.new do
  to              "user@example.com"
  from            "sender@example.com"
  subject         "test"
  delivery_method Mail::MadMimi, :email => "sender@example.com", :api_key => "1234"
end

mail.deliver

Headers and options

The :to, :from, :bcc, and :subject headers are taken from the Mail object passed to deliver!

In addition, any hash values given as a :mad_mimi header are passed on to Mad Mimi. That means if you use the Mail object with a different delivery method, you'll get an ugly mad_mimi header.

You can see other available options on the Mad Mimi developer site.

HTML (:raw_html) and plain text (:raw_plain_text) bodies are extracted from the Mail object.

Use :list_name => "beta users" to send to a list or :to_all => true to send to all subscribers.

Mad Mimi macros

If you are sending to an individual email address, the body must include [[tracking_beacon]] or [[peek_image]].

If you are sending to a list or everyone, the body must include [[opt_out]] or [[unsubscribe]].

An exception will be raised if you don't include a macro. When debugging, you may want to set raise_delivery_errors = true on your Mail object.

Rails 3 support

If ActionMailer is loaded, Mail::MadMimi registers itself as a delivery method.

You can then configure it in an environment file:

config.action_mailer.delivery_method = :mad_mimi
config.action_mailer.mad_mimi_settings = {
  :email   => "user@example.com",
  :api_key => "a1b9892611956aa13a5ab9ccf01f4966",
}