Project

sendable

0.0
No commit activity in last 3 years
No release in over 3 years
Sendable client for Ruby.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
~> 10.0
~> 3.0
 Project Readme

Sendable

Ruby library for sending email via the Sendable REST API.

sendable.io

Installation

Add this line to your application's Gemfile:

gem 'sendable'

And then execute:

$ bundle

Or install it yourself as:

$ gem install sendable

Configuration

Sendable.config do |config|
  config.api_key = 'YOUR API KEY'
end

Usage

Render

Returns the rendered HTML for your template.

render arguments

  • template - string - Your email template's id
  • params - hash - Object containing the following keys
    • data - hash - Any email template data that will replace the email template variables
result = Sendable.client.render(1, {
  data: {
    first_name: 'John',
    age: 28
  }
})

render response

{
  success: true,
  email: {
    html: "<html><head></head><body><h1>Sample HTML</h1></body></html>",
    plain: "Sample Plain Text",
    subject: "Sample Subject",
    preheader: "Sample Preheader"
  }
}

Email

Sends the email using your configured SMTP mailer in Sendable.

email arguments

  • template - string - Your email template's id
  • params - hash - Object containing the following keys
    • to - string - This is the recipient's email address
    • from - string - This is the sender's email address
    • data - hash - Any email template data that will replace the email template variables
result = Sendable.client.email(1, {
  to: 'john@doe.com',
  from: 'me@awesomesite.com',
  data: {
    first_name: 'John',
    age: 28
  }
})

email response

{
  success: true,
  email: {
    html: "<html><head></head><body><h1>Sample HTML</h1></body></html>",
    plain: "Sample Plain Text",
    subject: "Sample Subject",
    preheader: "Sample Preheader"
  },
  delivery: {}
}

The delivery key will include the response from your ESP.

License

The gem is available as open source under the terms of the MIT License.