Skip to content
Igor Polevoy edited this page Apr 20, 2016 · 1 revision

ExpressPigeon Gem usage

Installing

This is self-explanatory:

 gem install expresspigeon-ruby

Sending a transactional message

Here is a simple script for sending a message:

require 'expresspigeon-ruby'

MESSAGES = ExpressPigeon::API.messages.auth_key 'XXX'
puts MESSAGES.send_message 1234, 'john@doe.com', 'jane@@doe.com', 'Jane Doe', 'Dinner tonight?',   :first_name => 'John'

The output will be:

{"code"=>200, "id"=>4567, "message"=>"email queued", "status"=>"success"}

where:

  • XXX is your Authentication key. You can get it from the Integration page in your account: https://expresspigeon.com/settings/integrations (expand the ExpressPigeon section)
  • 1234 - template ID. You can get it from the URL when viewing a template in editor.
  • john@doe.com - a destination address
  • jane@doe.com - reply to address
  • Jane Doe - from name
  • Dinner tonight - message subject
  • 'John' - this is a dynamic value. If the template has a placeholder defined: ${first_name} , it will merge this value into a template before sending. You can provide as many as you want, since that argument is a Hash.
  • 4567 - this is an ID of this specific message. You can use it later to find out the status of this message (delivered, opened, clicked, etc.)

Clone this wiki locally