Framework Integration

Ruby on Rails + Unosend

Send transactional emails from your Ruby on Rails application using Unosend. Integrate with Action Mailer or use the REST API directly for reliable email delivery.

Features

Everything you need to send emails from Ruby on Rails

Action Mailer compatible

ERB template support

Active Job async delivery

Webhook event handling

Rails credentials integration

Quick Start

Get up and running in minutes with this code example

Code Example
# app/mailers/user_mailer.rb
class UserMailer < ApplicationMailer
  def welcome_email(user)
    @user = user
    # Uses Unosend SMTP or API adapter
    mail(
      to: @user.email,
      subject: "Welcome to Our App!"
    )
  end
end

# Or use the REST API directly
require 'net/http'
require 'json'

uri = URI('https://api.unosend.co/v1/emails')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::Post.new(uri)
request['Authorization'] = "Bearer #{ENV['UNOSEND_API_KEY']}"
request['Content-Type'] = 'application/json'
request.body = { from: 'hello@yourdomain.com', to: email, subject: subject, html: body }.to_json

response = http.request(request)

Setup Guide

Follow these steps to integrate Unosend with Ruby on Rails

1

Add your UNOSEND_API_KEY to Rails credentials or environment

2

Configure Action Mailer with Unosend SMTP settings

3

Or create a custom delivery method using the REST API

4

Create mailer classes as usual

5

Send emails using deliver_now or deliver_later

Why Use Unosend with Ruby on Rails?

Works with existing Action Mailer setup

Async delivery with Active Job

Better deliverability than Sendmail

Email open and click tracking

Ready to integrate?

Start sending emails from Ruby on Rails in under 5 minutes. Free tier includes 5,000 emails/month.