Contactology::Mailer
This library provides an ActionMailer-based hook into sending transactional campaigns through Contactology.
Example
# config/initializers/contactology.rb
Contactology.key = 'MyContactologyApiKey'
# app/mailers/user_mailer.rb
class UserMailer < Contactology::Mailer
def welcome(user)
# Sets the transactional campaign recipients
recipients user.email
# Sets the "replacements" for the campaign
body :user_name => user.name, :email => user.email
end
end
# Sends via a Contactology "welcome" transaction campaign.
# The "welcome" campaign would be created through another means.
UserMailer.deliver_welcome(User.first)
Installation
Installation is done through Rubygems with gem install contactology-mailer
.
More information
- contactology gem: Learn more about the contactology gem running behind this mailer
- Contactology API: Read the documentation on the current Contactology API