Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby client library for SendHub.net
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
.gitignore
LICENSE
README.textile
sendhub.gemspec

README.textile

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 => 'me@example.com',
  :to => 'you@example.com',
  :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
Something went wrong with that request. Please try again.