The project is in a healthy, maintained state
A Rails delivery method that uses the Sidemail transactional API for sending outgoing mail.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 6.0.0
 Project Readme

Sidemail::Delivery

A Rails delivery method that uses the Sidemail transactional API for sending outgoing mail.

Installation

Add this line to your application's Gemfile:

gem "sidemail-delivery"

And then execute:

$ bundle

Create an initializer in config/initializers/sidemail_delivery.rb to configure your Sidemail API key:

Sidemail::Delivery.configure do |config|
  config.api_key = "YOUR_API_KEY"
end

Now set your delivery method for your preferred environment, for example in config/environments/production.rb:

Rails.application.configure do
  # ...
  config.action_mailer.delivery_method = :sidemail
  # ...
end

Usage

After the installation your existing mailers will automatically send their html/text views through Sidemail. You might need to contact Sidemail support to enable HTML sending through their API. They disable it by default to prevent abuse.

If you want to use templates you can modify your mailers to include the template name and properties in the mail call and pass an empty body to avoid the need for having a mailer view. For example:

mail(to: "somebody@example.com", template: "my-template-name", template_props: { name: "Somebody" }, body: "")

License

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