/sendgrid-actionmailer

Rails support via ActionMailer

Primary LanguageRubyMIT LicenseMIT

SendGrid ActionMailer

An ActionMailer adapter to send email using SendGrid's HTTPS Web API (instead of SMTP).

Installation

Add this line to your application's Gemfile:

gem 'sendgrid-actionmailer', github: 'nanocity/sendgrid-actionmailer'

Usage

Create a SendGrid API Key for your application. Then edit config/application.rb or config/environments/$ENVIRONMENT.rb and add/change the following to the ActionMailer configuration:

config.action_mailer.delivery_method = :sendgrid_actionmailer
config.action_mailer.sendgrid_actionmailer_settings = {
  api_key: ENV['SENDGRID_API_KEY'],
  raise_delivery_errors: true
}

Normal ActionMailer usage will now transparently be sent using SendGrid's Web API.