Skip to main content

Prerequisites

Before you start, you’ll need:

Guide

1

Install

Get the Resend Ruby SDK.
2

Send email using Rails Action Mailer

This gem can be used as an Action Mailer delivery method.First, let’s update or create your mailer initializer file with your Resend API Key.
config/initializers/mailer.rb
Add these lines of code into your environment config file.
config/environments/environment.rb
Then create a UserMailer class definition.
app/mailers/user_mailer.rb
And create your ERB email template.
app/views/user_mailer/welcome_email.html.erb
Initialize your UserMailer class. This returns an ActionMailer::MessageDelivery instance.
Finally, you can now send emails using the deliver_now! method:

Examples

Rails App

Full Rails web application

Basic Send

Basic email sending

Attachments

Send emails with file attachments

Templates

Send emails using Resend hosted templates

Scheduling

Schedule emails for future delivery

Audiences

Manage contacts and audiences

Domains

Create and manage sending domains

Inbound Webhooks

Receive and process inbound emails

Double Opt-in

Double opt-in subscription flow