Member-only story
Send emails on Rails using SendGrid
A quick email setup using Rails, Action Mailer, Devise, and SendGrid.
Step 1: SendGrid
Create an account
First, if you don't have one already, you'll need to create a SendGrid account.
Set up a sender identity
Once you're done, set up a sender identity on SendGrid. You can find this option under Settings > Sender Authentication > Verify a Single Sender, or just follow the link: https://app.sendgrid.com/settings/sender_auth/senders
Make sure to verify your email address.
Create your first API key
You can create an API key via the left menu Settings > API Keys, or follow this direct link to https://app.sendgrid.com/settings/api_keys
Make sure to create an API key with full access and store it safely. I usually keep mine within my rails credentials file.
Step 2: Rails & Action Mailer & Devise
Install rails dependencies
Start by adding the line ruby client gem to your Gemfile:
gem 'sendgrid-ruby'