Learn how to send your first email using Sinatra and the Resend Ruby SDK.
gem install resend
html
require "sinatra" require "resend" set :port, 5000 set :bind, "0.0.0.0" Resend.api_key = ENV["RESEND_API_KEY"] get "/" do content_type :json params = { from: 'Acme <onboarding@resend.dev>', to: ['delivered@resend.dev'], subject: 'hello world', html: '<strong>it works!</strong>', } Resend::Emails.send(params).to_hash.to_json end
Was this page helpful?