Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

Latest commit

 

History

History
70 lines (53 loc) · 1.39 KB

README.textile

File metadata and controls

70 lines (53 loc) · 1.39 KB

The Ruby Client library for SendHub.net

SendHub is an outbound ‘transactional mail’ web service. It means you don’t need to maintain your own
mail servers and you can get callbacks into your application if mail bounces etc..

Setup & Installation

Create an account on SendHub to obtain your API keys

sudo gem install sendhub

Simple Ruby Example

client = Sendhub::Client.new(
  :api_key => 'YOUR_API_KEY',
  :secret_key => 'YOUR_SECRET_KEY'
)

res = client.send_email(
  :from => '[email protected]',
  :to => '[email protected]',
  :subject => 'Testing SendHub Integration',
  :body => 'Testing...'
)

Rails 2.x Example

config/enviroment.rb

Rails::Initializer.run do |config|
  ...
  config.gem 'sendhub'
  require 'sendhub'
  ...
end

config/enviroments/production.rb

...
config.action_mailer.delivery_method = :sendhub
config.action_mailer.sendhub_settings = {
  :api_key => "YOUR_API_KEY",
  :secret_key => "YOUR_SECRET_KEY"
}
...

Rails 3.x Example

Gemfile

...
gem 'sendhub'
...

config/enviroments/production.rb

YOUR_APP::Application.configure do
  ...
  config.action_mailer.delivery_method = :sendhub
  config.action_mailer.sendhub_settings = {
    :api_key => "YOUR_API_KEY",
    :secret_key => "YOUR_SECRET_KEY"
  }
  ...
end