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..
Create an account on SendHub to obtain your API keys
sudo gem install sendhub
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...'
)
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"
}
...
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