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

moocode/sendhub_ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Ruby client library for SendHub.net

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages