Documentation · Website · RubyGems · GitHub
The official Ruby library for Resent transactional email.
gem install resentOr add to your Gemfile:
gem "resent"bundle install- Verify a sending domain in the Resent dashboard
- Create an API key under Settings → API keys
- Store it as
RESENT_API_KEY
require "resent"
resent = Resent.new(ENV.fetch("RESENT_API_KEY"))require "resent"
resent = Resent.new(ENV.fetch("RESENT_API_KEY"))
result = resent.emails.send(
from: "Acme <noreply@yourdomain.com>",
to: "you@example.com",
subject: "Hello World",
html: "<p>Congrats on sending your <strong>first email</strong> with Resent!</p>"
)
puts result["submission_id"]result = resent.emails.send(
from: "Acme <noreply@yourdomain.com>",
to: ["you@example.com"],
subject: "Hello World",
html: "<strong>It works!</strong>"
)result = resent.emails.send(
from: "Acme <noreply@yourdomain.com>",
to: "you@example.com",
subject: "Hello World",
text: "It works!"
)MIT © Resent
