0.0
No commit activity in last 3 years
No release in over 3 years
A simple library for integrating with the CheetahMail API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 0
 Project Readme

CheetahMail for ruby

A fork of Dan Rodriguez' original gem which interacts with the CheetahMail API. This is an attempt to make it work with newer rubies (the original only seemed to work ruby 1.8.x).

To use this fork in your project, add to your Gemfile:

gem 'cheetah_mail', git: 'https://github.com/adamtao/cheetah_mail.git'

Then run bundler.

Usage

Basically you create a Cheetah instance like so:

cheetah = CheetahMail::CheetahMail.new({
  :host             => 'ebm.cheetahmail.com',
  :username         => 'foo_api_user',
  :password         => '12345',
  :aid              => '67890',                  # the 'affiliate id'
  :whitelist_filter => //,                       # if set, emails will only be sent to addresses which match this pattern
  :enable_tracking  => true,                     # determines whether cheetahmail will track the sending of emails for analytics purposes
  :messenger        => CheetahMail::ResqueMessenger
})

Options for :messenger include CheetahMail::ResqueMessenger or CheetahMail::SynchronousMessenger .

To send a message:

cheetah.send_email(
  eid,    # cheetahmail's EID for the event triggered email
  email,
  params, # a hash of parameters used to populate any dynamic fields in the email template
)

To add or update a description:

cheetah.mailing_list_update(
  email,
  params # a hash of parameters to populate the mailing list fields with
)

Finally, update someone's email address:

cheetah.mailing_list_email_change(
  oldemail,
  newemail
)