Render25 Ruby SDK

The official Ruby gem for the Render25 transactional email platform.

Gem Version License: MIT

Installation

Add this line to your application's Gemfile:

gem 'render25'

And then execute:

bundle install

Or install it yourself as:

gem install render25

Quickstart

require 'render25'

# Automatically loads RENDER25_API_KEY from environment
client = Render25.new

# Or pass explicitly: client = Render25.new('re_live_...')

response = client.emails.send(
  from: 'support@yourdomain.com',
  to: 'user@example.com',
  subject: 'Welcome to Render25!',
  html: '<h1>Welcome aboard!</h1><p>Transactional email delivered via Ruby.</p>',
  text: 'Welcome aboard! Transactional email delivered via Ruby.'
)

puts "Dispatched ID: #{response['id']}"

Advanced: CC, BCC, Reply-To & Attachments

require 'render25'

client = Render25.new

response = client.emails.send(
  from: 'support@yourdomain.com',
  to: ['client@example.com'],
  cc: ['accounting@example.com'],
  bcc: ['archive@example.com'],
  reply_to: 'helpdesk@yourdomain.com',
  subject: 'Your Invoice #1042',
  html: '<p>Please find your receipt and invoice attached.</p>',
  attachments: [
    {
      filename: 'invoice_1042.pdf',
      content: File.binread('invoice.pdf'), # Pass binary string or file path
      content_type: 'application/pdf'
    }
  ]
)

Ruby on Rails Integration

In config/environments/production.rb:

# Using ActionMailer with SMTP relay
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  address:              'smtp.render25.com',
  port:                 587,
  user_name:            ENV['RENDER25_USERNAME'],
  password:             ENV['RENDER25_API_KEY'],
  authentication:       :plain,
  enable_starttls_auto: true
}

License

MIT © Render25