Skip to main content

The client

send_mail and deliver_mail are aliases. email_disposition and message_receipt are aliases.

Building a message

Attachments

Attach files by path using the helper method:
Or set the attachments attribute directly with an array of hashes (each with fileName, contentType, and base64-encoded content):

Send a message

Check delivery status

EmailDisposition fields: Each MessageDelivery struct has recipient and status. The status struct has delivery_status, delivery_time, opened_status, and opened_time. Check disposition.errors? to detect API-level errors. Common delivery_status values: delivered, opened, failed, pending.

Dynamic templates

Templates use Handlebars syntax ({{variable_name}}).

Create a template

List templates

Get a template

Update a template

Delete a template

Send a templated message

Error handling

Methods raise RestClient::ExceptionWithResponse on HTTP errors. Rescue it to inspect the response: