boundry.
RegionSydney, Australia

Boundry with Sinatra

Create the client at boot and call the helper from a route or background worker.

Install

This guide uses the official boundry package. Its generated source is public on GitHub.

terminalShell
Shell
gem install boundry

Add the server-side helper

Store BOUNDRY_API_KEY in the framework’s secret or server environment. Never include a project key in browser code.

lib/email.rb
ruby
require 'boundry'

CLIENT = Boundry::Client.new(api_key: ENV['BOUNDRY_API_KEY'])

def send_welcome_email(to)
  CLIENT.emails.send(
    from: 'Acme <hello@acme.com>',
    to: to,
    subject: 'Welcome to Acme',
    html: '<p>It works.</p>'
  )
end

Production checklist

  • Send only from a domain verified in this regional project.
  • Move user-facing sends to the framework’s job system when available.
  • Reuse an idempotency key if you retry after an uncertain response.