Official Ruby SDK for reliable delivery
Send email in Ruby from scripts, jobs, and web apps with Sidemail's clean email API and official gem. Sidemail takes care of deliverability, authentication, and infrastructure so your Ruby code focuses on application logic while the platform delivers emails reliably.
Get startedRead API docsrequire "sidemail"
sm = Sidemail.new
sm.send_email(
toAddress: "[email protected]",
fromAddress: "[email protected]",
fromName: "Your App",
templateName: "Welcome",
templateProps: {
firstName: user.name,
},
)Follow these three steps to get your first Sidemail powered email out of a Ruby script or app.
Add Sidemail to your environment with RubyGems:
gem install sidemailCreate a Sidemail client and let it read SIDEMAIL_API_KEY from your environment, or pass the API key explicitly.
require "sidemail"
# Reads SIDEMAIL_API_KEY from your environment automatically
sm = Sidemail.new
# or: sm = Sidemail.new(api_key: ENV["SIDEMAIL_API_KEY"])Call sm.send_email with recipient, sender, and either a Sidemail template or raw content. Sidemail takes care of the authentication, rendering, and delivery.
# Example: send a welcome email template
sm.send_email(
toAddress: "[email protected]",
fromAddress: "[email protected]",
fromName: "Your App",
templateName: "Welcome", # template stored in Sidemail
templateProps: { firstName: "Alice" }, # dynamic data for template variables
)Key features & perks
SIDEMAIL_API_KEY, and call one method. Sidemail keeps the integration close to normal Ruby conventions, so you can get from zero to sent email in under 30 minutes.With Sidemail, you can send any transactional emails such as verification, receipts, password resets, and scheduled onboarding or reports, all through the same send_email call.
# Ruby: Send a password reset email with a Sidemail template
sm.send_email(
toAddress: "[email protected]",
fromAddress: "[email protected]",
fromName: "Your App",
templateName: "Password Reset",
templateProps: {
actionUrl: "https://yourapp.com/reset/#{token}",
},
)Send a secure reset link right after a user requests a password change.
# Ruby: Send a payment receipt email template
sm.send_email(
toAddress: "[email protected]",
fromAddress: "[email protected]",
fromName: "Your App",
templateName: "Payment Receipt",
templateProps: {
userName: user.name,
amount: "$19.99",
date: Date.today.iso8601,
},
)Send a receipt, invoice, or similar post purchase message as soon as an important event finishes.
templateProps to inject dynamic values while keeping the template design stable.# Ruby: Schedule a welcome email for 1 hour from now
require "date"
scheduled_at = (Time.now + 60 * 60).utc.iso8601
sm.send_email(
toAddress: "[email protected]",
fromAddress: "[email protected]",
fromName: "Your App",
templateName: "Welcome",
templateProps: { firstName: "Alex" },
scheduledAt: scheduled_at,
)Schedule a welcome email for later, for example an hour after sign up.
scheduledAt to a future ISO timestamp to control when the message is sent.# Ruby: Send a weekly report email with markdown
markdown_content = File.read("templates/emails/weekly-report.md")
sm.send_email(
toAddress: "[email protected]",
markdown: markdown_content,
templateProps: {
firstName: "Alex",
newUsers: "128",
totalRevenue: "$4,320",
topFeature: "Dashboard",
},
)---
subject: "Your weekly report is ready"
fromAddress: "[email protected]"
fromName: "Your App"
---
Hi {firstName}, here is your weekly summary.
## Key metrics
- **New users:** {newUsers}
- **Revenue:** {totalRevenue}
- **Top feature:** {topFeature}
[$btn View full report](https://yourapp.com/reports/latest)Sidemail lets you write email content in Markdown, then turns it into responsive HTML that matches your project's email design. That means faster authoring in Ruby and less HTML to maintain.
.md file. Headings, lists, and bold text render automatically.Deliverability best practices
SPF and DKIM help mailbox providers verify that your transactional emails are genuinely sent from your domain. DMARC adds policy and alignment on top of that, which matters for sender reputation and inbox placement.
Sidemail walks you through domain verification and the DNS records needed for production sending, so your Ruby app sends authenticated, best‑practice‑compliant emails from day one.




The simplest way to build emails
Build responsive email templates with Sidemail's visual editor. Add your logo, adjust brand colors, and create production ready emails without wrestling with HTML tables or client quirks.
If you need to move faster, import a premade template for welcome emails, password resets, receipts, and more. Every template is designed to render well across inboxes, so your Ruby app can focus on sending logic instead of email layout edge cases.
Learn moreDeveloper friendly formatting
Writing HTML emails by hand is slow and fragile, especially when the content itself is simple.
Sidemail lets you keep the email body in Markdown, define the subject and sender in frontmatter, and convert everything into a responsive HTML email automatically. Headings, lists, links, buttons, and variables all work out of the box.
It is a practical fit for Ruby transactional emails – clean authoring, reusable files, and no HTML debugging loop.
Learn more
Ready to send transactional emails from Ruby? Sidemail gives you a native Ruby library, email API, tested templates, no‑code editor, and more in one email platform. Install the gem, set your API key, and send your first email in minutes.
Start free trialThe simplest approach is to use Sidemail's Ruby SDK. Install the gem (gem install sidemail), initialize the client with your API key, and call sm.send_email(). Sidemail handles the API request, authentication, and deliverability layer for you.
Yes. You can use the same Ruby SDK in Rails controllers, service objects, and background jobs. If you want a Rails specific walkthrough, Sidemail also has a dedicated Ruby on Rails guide.
Create or import transactional templates in the Sidemail dashboard, then reference them from Ruby by setting templateName and providing a templateProps hash. Sidemail merges your data into the template, renders responsive HTML, and delivers it.
Yes. Read a markdown file with File.read(), pass it as the markdown parameter, and use markdown frontmatter for subject and sender. Sidemail converts the content into responsive HTML and maps variables from templateProps into the message.
Yes. Add a future ISO 8601 timestamp to the scheduledAt field in your sm.send_email() call. Sidemail queues the email and delivers it at the time you specify, which is useful for onboarding sequences, reminders, and delayed follow ups.
Yes. Use the Sidemail.file_to_attachment() helper to build the attachment object, then pass it in the attachments array. For example, read a PDF with File.read("invoice.pdf"), convert it with the helper, and include it in the send request.
Wrap your send call in a begin / rescue block and catch Sidemail::Error. The exception includes the message and can include HTTP status and error code details, which makes it straightforward to log failures and debug integration issues.