Send emails with Ruby
Prerequisites
Section titled “Prerequisites”Before you start, you'll need:
- A Resend API key
- A verified domain
Install
Get the Resend Ruby SDK.
RubyGems gem install resendGemfile gem 'resend'Send email using HTML
The easiest way to send an email is by using the
htmlparameter.index.rb require "resend" Resend.api_key = "re_xxxxxxxxx" params = { "from": "Acme <onboarding@resend.dev>", "to": ["delivered@resend.dev"], "subject": "hello world", "html": "<strong>it works!</strong>" } sent = Resend::Emails.send(params) puts sent
Examples
Section titled “Examples”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
Sinatra App
Full Sinatra web application
Rails App
Full Rails web application