MillionSend Ruby SDK — RubyGems: millionsend (MIT)
Repo MillionSend/millionsend-ruby, read from GitHub 2 h ago. MillionSend has not joined Take My Repo.
MillionSend/millionsend-ruby is a public repo on GitHub by MillionSend. MillionSend Ruby SDK — RubyGems: millionsend (MIT). It declares the MIT license on GitHub. It is written mainly in Ruby, has 1 stars and last changed on 2026-11-19. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-24.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
Official Ruby SDK for MillionSend — a self-hostable, Resend-compatible email API on AWS SES.
The API is wire-compatible with Resend, and this gem deliberately mirrors the shape of
resend, so migrating is mostly a find-and-replace:
swap the constant (and, on a self-hosted instance, set base_url).
gem install millionsend
Or in a Gemfile:
gem "millionsend"
Requires Ruby 3.0+. Only the standard library is used at runtime (net/http, json).
require "millionsend"
Millionsend.api_key = "ms_123"
# Millionsend.base_url = "https://mail.acme.dev" # self-hosted only; defaults to MillionSend Cloud
email = Millionsend::Emails.send(
from: "Acme <onboarding@acme.dev>",
to: "success@simulator.amazonses.com",
subject: "Hello from MillionSend",
html: "<strong>It works!</strong>"
)
puts email[:id]
Every call returns a symbol-keyed Hash on success and raises a Millionsend::Error
on any non-2xx response (see Error handling).
Millionsend.api_key = "ms_123" # falls back to ENV["MILLIONSEND_API_KEY"]
Millionsend.base_url = "https://mail.acme.dev" # falls back to ENV["MILLIONSEND_BASE_URL"],
# then https://api.millionsend.com (Cloud)
Millionsend.allow_insecure_http = false # accept a non-loopback http:// base_url
MillionSend Cloud works with just the API key; a self-hosted instance sets base_url to
its origin. An explicitly assigned value always wins over the environment.
Plain http:// is only accepted for loopback hosts (localhost, 127.0.0.1, ::1); any
other http:// URL raises Millionsend::ApplicationError on the first call, since the API
key is sent as a bearer header. Set allow_insecure_http = true to talk to a non-TLS
instance elsewhere (e.g. inside a private network).
Params are symbol-keyed hashes and go on the wire exactly as given — nothing is
filtered or renamed (Ruby's snake_case is already the wire's snake_case: reply_to,
scheduled_at, segment_id). A nil value is sent as JSON null, which is how the API
clears a nullable field (topic_id, first_name, a template alias, …); omit the key to
leave it unchanged.
Emails.send, Batch.send, Contacts::Batch.create and the receiving and inbox replies,
forwards and Drafts.send take a trailing options hash, in either of two shapes:
Millionsend::Emails.send(payload, idempotency_key: "order-42") # flat
Millionsend::Emails.send(payload, options: { idempotency_key: "order-42" }) # resend-ruby keyword shape
| option | header / query | where |
|---|---|---|
idempotency_key |
Idempotency-Key |
any POST |
batch_validation |
x-batch-validation |
Batch.send, Contacts::Batch.create |
on_conflict |
?on_conflict= |
Contacts::Batch.create |
batch_validation is "strict" by default (one invalid item rejects the whole batch) or
"permissive" (the valid subset is processed and the failures come back under errors:
as [{ index:, message: }]; Contacts::Batch.create adds each failure's statusCode: and
name:).
Lists answer { object: "list", data: [...], has_more: }, and the SDK never pages for you.
Most lists are newest first: after: takes the last id of a page and pages toward older
items, before: takes the first id and pages toward newer ones (a before: page is still
newest first). Threads come most recently active first, a thread's emails oldest first
(after: pages toward newer), drafts most recently updated first; labels and topics are
unpaginated.
# Incremental sync: only what is newer than the newest id already stored
page = Millionsend::Emails.list(limit: 100, before: newest_id)
until page[:data].empty?
store(page[:data])
newest_id = page[:data].first[:id]
break unless page[:has_more]
page = Millionsend::Emails.list(limit: 100, before: newest_id)
end
A cursor whose item was deleted raises ValidationError (NotFoundError on the Inboxes
lists): start again without a cursor and stop at the ids you already have. Servers before
v0.13.0 listed oldest first; walking every page with after: returns every item on both.
Millionsend::Emails.send(payload, idempotency_key: "order-42") # POST /emails
Millionsend::Emails.get(id) # GET /emails/:id (includes score: 0-10 or nil)
Millionsend::Emails.list(limit: 20, after: id) # GET /emails
Millionsend::Emails.update(id, scheduled_at: "in 2 hours") # PATCH /emails/:id (scheduled only)
Millionsend::Emails.cancel(id) # POST /emails/:id/cancel (scheduled only)
Millionsend::Emails.remove(id) # DELETE /emails/:id
Millionsend::Emails.get_insights(id) # GET /emails/:id/insights (404 until computed)
Millionsend::Batch.send([payload_a, payload_b], idempotency_key: "run-7", batch_validation: "permissive") # up to 100
The send payload accepts from, to, subject, html, text, cc, bcc, reply_to,
scheduled_at, tags: [{ name:, value: }], topic_id, headers: { "X-..." => "..." },
attachments: [{ filename:, content: <base64>, content_type:, content_id:, path: }] and
template (passed through; the server currently answers 422 for it). to, cc, bcc and
reply_to accept either a string or an array. Emails.create is an alias of Emails.send
(as is Batch.create), mirroring Resend. Emails.update also takes resend-ruby's single
hash: Emails.update(email_id: id, scheduled_at: ...).
subject takes up to 998 characters here, in batches and in broadcasts (inbox replies,
forwards and drafts take 2,000). A to, cc or bcc address whose domain can never receive
mail (example.com, .test, .invalid, a TLD that doesn't exist, …) raises ValidationError,
on replies, forwards and drafts too, and so does such an address on a new contact. To test
sending without emailing anyone, use success@simulator.amazonses.com.
from may be an inbox's address on the shared domain while the shared row
in Domains.list has sending_mode: "open": the inbox's exact email_address (no +tag),
no display name or its from_name, no reply_to, attachments, headers or scheduled_at,
and at most 10 distinct recipients across to, cc and bcc. Batch.send and broadcasts
never send from the shared domain: InboxSendPolicyError, or that item's entry in a
permissive batch's errors:.
Mail your domains receive: Resend's Emails::Receiving plus MillionSend's long-poll, server-side
reply and forward, and erase. Inbox-scoped keys never see mail held for screening or in quarantine.
page = Millionsend::Emails::Receiving.list(limit: 20) # GET /emails/receiving
email = Millionsend::Emails::Receiving.get(id, html_format: "cid") # GET /emails/receiving/:id
email[:extracted_text] # the visible text: hidden text and invisible characters removed
email[:screening] # { verdict:, sender_trust:, quarantine_reason:, injection_score:, ... }
email[:extracted] # { kinds:, code:, link:, ... } on verification mail
Millionsend::Emails::Receiving::Attachments.list(id) # each with a signed download_url (1 hour)
Millionsend::Emails::Receiving::Attachments.get(id, attachment_id) # also get(email_id:, id:) as in resend-ruby
Millionsend::Emails::Receiving.remove(id) # erase now (full-access keys)
# Long-poll: wait up to 50 s for the next match
page = Millionsend::Emails::Receiving.list(inbox_id: inbox[:id], from: "github.com", wait: 30)
page[:data] # what arrived
page[:held] # [{ id:, inbox_id:, reason:, quarantine_reason:, created_at: }] — matches held for screening or quarantine
# Reply and forward from the server, threaded
res = Millionsend::Emails::Receiving.reply(id, { text: "Thanks!" }, idempotency_key: "reply-#{id}")
res = Millionsend::Emails::Receiving.forward(id, { to: "ops@acme.dev", mode: "attachment" }) # the original as an .eml
List options go on the query as given: limit, after, before, wait (0–50), since,
inbox_id (an unknown one raises NotFoundError at once, even with wait), to, from (an
address, or a domain covering its subdomains), subject_contains, unread (with inbox_id,
or alone on an inbox-scoped key), and include_quarantined or quarantined (held mail too, or
only; full-access keys). reply also takes subject, cc, bcc, reply_all,
requires_approval, from and inbox_id.
reply and forward return { kind: "sent", data: { object: "email", id:, thread_id:, inbox_id: } },
or { kind: "draft", data: <draft> } when an inbox's rules hold the message for a person to
approve (HTTP 202); the draft's approval_reasons say why.
Addresses whose mail lands in threads, for an agent (kind: "agent", the default: screening, code
extraction and send rules on) or for people (kind: "human"). Mirrors Resend's Inboxes beta;
Safety, Codes and Quarantine are MillionSend extensions.
inbox = Millionsend::Inboxes.create(name: "Signup bot", username: "signup-bot") # signup-bot@<team>.<shared domain>
inbox = Millionsend::Inboxes.create(email_address: "support@acme.dev", kind: "human")
inbox = Millionsend::Inboxes.create(domain_id: domain[:id], username: "billing") # billing@<that domain>
Millionsend::Inboxes.list(kind: "agent")
Millionsend::Inboxes.get("support@acme.dev") # by id or address
Millionsend::Inboxes.update(inbox[:id], name: "Support", from_name: "Acme Support", expires_in: nil) # nil: never expires
Millionsend::Inboxes.remove(inbox[:id]) # also revokes its inbox-scoped keys
# Safety rules: who may write in and what an agent may send
Millionsend::Inboxes::Safety.get(inbox[:id])
Millionsend::Inboxes::Safety.update(inbox[:id], accept_from: "allowlist", allowlist: ["*@stripe.com"], send_cap: nil)
# Verification codes and sign-in links (links are never fetched); waits up to 50 s
code = Millionsend::Inboxes::Codes.latest(inbox[:id], from: "github.com", wait: 30, max_age: 600)
code[:status] # "found" | "none" | "ambiguous" | "timeout"
code[:code] # "482913", or code[:url] for a sign-in link
# A second sign-in waits for its own code: only mail received after the one already used counts
Millionsend::Inboxes::Codes.latest(inbox[:id], from: "github.com", wait: 30, since: code[:received_at])
# Quarantine: held mail is kept and listed; agents see it only once a person releases it
Millionsend::Inboxes::Quarantine.list(inbox[:id])
Millionsend::Inboxes::Quarantine.release(inbox[:id], email_id)
# Threads and their messages
Millionsend::Inboxes::Threads.list(inbox[:id], folders: ["inbox", "archive"], read: false)
Millionsend::Inboxes::Threads.search(inbox[:id], query: "invoice", from: ["stripe.com"])
Millionsend::Inboxes::Threads.get(inbox[:id], thread_id)
Millionsend::Inboxes::Threads.update(inbox[:id], thread_id, read: true, folder: "archive", label_id: label_id)
Millionsend::Inboxes::Threads.remove(inbox[:id], thread_id) # to trash, purged after 30 days
Millionsend::Inboxes::Threads::Emails.list(inbox[:id], thread_id) # oldest first; include_quarantined: true for held mail too
Millionsend::Inboxes::Threads::Emails.get(inbox[:id], thread_id, email_id)
res = Millionsend::Inboxes::Threads::Emails.reply(inbox[:id], thread_id, email_id, { text: "On it." }, idempotency_key: "k1")
Millionsend::Inboxes::Threads::Emails.forward(inbox[:id], thread_id, email_id, { to: "ops@acme.dev" })
# Labels
label = Millionsend::Inboxes::Labels.create(inbox[:id], name: "Billing", color: "#FFAA00")
Millionsend::Inboxes::Labels.list(inbox[:id])
Millionsend::Inboxes::Labels.update(inbox[:id], label[:id], name: "Invoices")
Millionsend::Inboxes::Labels.remove(inbox[:id], label[:id])
# Drafts
draft = Millionsend::Inboxes::Drafts.create(inbox[:id], to: ["ada@x.dev"], subject: "Hello", text: "Hi Ada")
Millionsend::Inboxes::Drafts.list(inbox[:id])
Millionsend::Inboxes::Drafts.get(inbox[:id], draft[:id])
Millionsend::Inboxes::Drafts.update(inbox[:id], draft[:id], subject: nil) # nil clears
Millionsend::Inboxes::Drafts.send(inbox[:id], draft[:id], idempotency_key: "draft-1")
Millionsend::Inboxes::Drafts.reject(inbox[:id], draft[:id]) # approvers only
Millionsend::Inboxes::Drafts.remove(inbox[:id], draft[:id])
Thread replies, forwards and Drafts.send return { kind: "sent", data: ... }, or
{ kind: "draft", data: <draft> } when the inbox's rules hold the message for approval; an
agent's reply to a Reply-To at another organization is held with approval_reasons including
"reply_to_redirect". An inbox-scoped key or an MCP token cannot send a draft that waits for
approval (ApprovalRequiredError); a person in the dashboard or a full-access team key can.
Arrays in list and search options (folders, labels, from, to, cc, bcc) go out as one
comma-separated value. With include_quarantined: true (full-access team keys), Threads.list
and search items carry quarantined:, the count of held messages. Inbox names take 1–320
characters. Resend's hosted agent settings (/inboxes/:id/agent) are not exposed: MillionSend
runs no agent.
On an agent inbox with screening on, mail held before screening ran (not_allowlisted,
unauthenticated_sender, failed_auth
MillionSend/millionsend-ruby is a public repo on GitHub by MillionSend. MillionSend Ruby SDK — RubyGems: millionsend (MIT).
It declares the MIT license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-11-19. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
Take My Repo cannot say: it does not audit code and has not run millionsend-ruby. What is known comes from GitHub. It declares the MIT license on GitHub. Its last change was on 2026-11-19. It has 1 stars, which measure popularity, not safety. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read the source before you run it. With "Take it", your AI agent shows each step and asks you before running it; README text is treated as data, not as instructions.