Skip to content

Latest commit

 

History

History
70 lines (52 loc) · 1.83 KB

README.md

File metadata and controls

70 lines (52 loc) · 1.83 KB

Exact::Target

This Gem provides an interface to ExactTarget's TriggeredSend API. Albert plan add other Exact Target functions in this forked version. This includes add list, add subscriber to list, delete subscriber from list, update subscriber.

Installation

Add this line to your application's Gemfile:

gem 'exact-target', :git =>'git://github.com/nwb/exact-target'

And then execute:

$ bundle

Or install it yourself as:

$ gem install exact-target

Usage

ExactTarget's API isn't exactly SOAP. It is SOAP-like, however if you actually use the WDSL, it provides invalid endpoints. In addition the XML formats required could be describe as interesting and can be quite fragile.

This gem endeavors to take some of the pain out of the process of sending triggered email.

Configuration

ExactTarget.configure do |config|
  config.username = 'test'
  config.password = 'test'
  config.server = 'webservice.exacttarget.com'
end

server is the ExactTarget server your account is assigned to, usually one of webservice.exacttarget.com, webservice.s4.exacttarget.com or webservice.s6.exacttarget.com

Triggering an Email

trigger = ExactTarget::TriggeredSend.new
template = 42            # The template ID from the ExactTarget web interface
email = '[email protected] # Recipient
# The keys of the attributes hash are the name of the variables in the
# ExactTarget template
attributes = {
  'Subject'=> '...',
  'Email Address' => '...',
  'First Name' => '...',
  'Last Name' => '...',
  'MobilePhone' => '...',
  'Message' => '...'
}
trigger.send(template,email,attributes)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request