Every dashboard action is an MCP tool your agent can call.Read the docs
Ruby email API

Send product email from Ruby. Keep callbacks out of the way.

Send transactional email and publish lifecycle events from Ruby services and background jobs with the Send & Retain API.

Put the HTTP call in a service object and retries in Active Job or Sidekiq.

Server quickstart
Ruby

One request, complete trace

Request

POST /api/v1/emails

Authorization: Bearer aem_…

Idempotency-Key: welcome-8f21

{ "to": "[email protected]", "template": "welcome" }

202 Accepted

{ "id": "msg_7ca31", "status": "queued" }

RuntimeServer process
RequestPOST /api/v1/emails
Result202 · queued
Credentials stay server-side

[ 01 / 04 ]Client contract

Make email an explicit service, not a hidden callback.

Use the client you already know

Call the stable HTTP API with Net::HTTP, Faraday, or the HTTP library already in your service.

Send typed payloads

Keyword arguments for sender, recipients, template, and props, with symbol keys throughout.

Handle delivery events

Use request.raw_post for signature verification and skip forgery protection on that route only.

[ 02 / 04 ]Server quickstart

Queue one email from Ruby.

The credential never leaves your server. The ID follows the message.

Put the request in a service or background job rather than a model callback.

send_welcome.rb
request = Net::HTTP::Post.new(URI(EMAIL_URL))
request['Authorization'] = "Bearer #{ENV.fetch('AEM_KEY')}"
request['Idempotency-Key'] = "welcome-#{user.id}"
request['Content-Type'] = 'application/json'
request.body = { to: user.email, template: 'welcome' }.to_json

Accepted response

{ "id": "msg_7ca31", "status": "queued" }

[ 03 / 04 ]Quickstart

Give each send an obvious owner and retry path.

01

Wrap the API in a service object

Centralize the key, timeout, error handling, and idempotency convention.

02

Enqueue after commit

Send from Active Job or Sidekiq after the application record has been committed.

03

Return evidence to the job

Store the accepted message ID so retries and support checks refer to the same send.

Production checklist

  • Secrets stay server-side
  • Timeout and retry policy
  • Idempotent webhook handler
  • Structured error logging

Questions people ask us

Queue your first Ruby email.

Call from a service or job, then keep the returned ID for the delivery trace.