SuperSend TX with Ruby

Use the Ruby SDK in Rails, Sinatra, Sidekiq jobs, or any server-side Ruby app where your API key can stay private.

1. Install the SDK

gem install supersendtx

Or add to your Gemfile:

gem "supersendtx", "~> 0.8"

2. Configure your API key

export SUPERSENDTX_API_KEY=stx_your_key_here

3. Send an email

require "supersendtx"

tx = SuperSendTX::Client.new(ENV.fetch("SUPERSENDTX_API_KEY"))

result = tx.emails.send(
  from: "ops@yourdomain.com",
  to: "user@example.com",
  subject: "Your receipt",
  html: "<p>Thanks for your purchase.</p>"
)

puts result["id"], result["status"]

Resources

The client includes thin wrappers for common API resources:

  • tx.emails — send, batch, list, cancel, resend, test webhooks, deliverability insights
  • tx.domains — create, verify, apply DNS, update, delete
  • tx.webhooks — CRUD for webhook endpoints
  • tx.templates — CRUD plus publish
  • tx.suppressions — list, create, remove

See the API reference for request fields. The Ruby SDK accepts the same JSON shapes as the REST API.

Source

Package source lives in ruby/ in the public supersendtx-sdks repository.