Class: MadMimi::Mailer

Inherits:
Object
  • Object
show all
Includes:
Request
Defined in:
lib/mad_mimi/mailer.rb

Overview

The Mailer API that lets you use Mad Mimi to send your transactional emails like welcome letters, password resets, and account activations. You can also use it to programmatically send promotional emails to an audience list.

Instance Method Summary collapse

Methods included from Request

#get, #post

Instance Method Details

#mail(options = {}) ⇒ Object

Sending transactional email

Sends a single transactional email to the recipient. Returns a unique transaction id if successful.

Required parameters are:

  • :promotion_name – The name of the promotion Mimi will send. For raw_html or raw_plain_text promotions, Mad Mimi will automatically create or update the promotion in your account.

  • :recipients – The recipient (singular although the parameter name is plural) again just the email or in Display Name <[email protected]> format.

  • :body – Required if you have placeholders. YAML encoded replacements for any placeholders in your promotion.

Optional parameters are:

  • :subject – The subject of the email. Will default to the promotion_name if not supplied.

  • :from – The from address. Just the email address or in Display Name <[email protected]> format.

  • :bcc – An email address to BCC. Just the email address.

  • :raw_html – The custom HTML to send. Can be used on its own or in conjunction with raw_plain_text.

  • :raw_plain_text – The custom plain text to send. Can be used on its own or in conjunction with raw_html.

  • :check_suppressed – Checks if the recipient is suppressed and does not send if so (default: on).

  • :track_links – Enable or disable link tracking in HTML promotions (default: on).

  • :hidden – Creates the promotion as a hidden promotion so as not to clutter up your web interface (default: off).

See Sending transactional email with the Mailer API



31
32
33
34
# File 'lib/mad_mimi/mailer.rb', line 31

def mail(options = {})
  options[:check_suppressed] ||= true
  post("/mailer", options, true, true)
end