Send transactional emails, retrieve sending history, and track delivery status per message.
Summary
Functions
Cancel Email
List Emails
Retrieve Bulk Emails
Retrieve Email
Retrieve Email Content
Retrieve Email Events
Retrieve Email Stats
Send Bulk Emails
Send Email
Functions
Cancel Email
Cancel a scheduled email before delivery. Only emails with scheduled status can be cancelled.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.id— Required path parameter, string. The id of the emailopts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Emails.cancel_email(client, "id")
List Emails
Returns sent emails ordered by submission date, newest first.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.params— Optional map of query parameters:"cursor"— Optional query parameter, string. Pagination cursor from a previous response"limit"— Optional query parameter, integer. Maximum number of items to return Defaults to30.
opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Emails.list_emails(
client,
%{
"cursor" => "cursor",
"limit" => 30
}
)
Retrieve Bulk Emails
Returns the emails submitted in a bulk request.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.bulk_id— Required path parameter, string.opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Emails.retrieve_bulk_emails(client, "bulk-id")
Retrieve Email
Returns an email with its current delivery status and metadata.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.id— Required path parameter, string. The id of the emailopts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Emails.retrieve_email(client, "id")
Retrieve Email Content
Returns presigned URLs to download the HTML, plain-text, and raw MIME source of a sent email.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.id— Required path parameter, string.opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Emails.retrieve_email_content(client, "id")
Retrieve Email Events
Returns the delivery event history for an email (sent, delivered, opened, bounced, etc.).
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.id— Required path parameter, string.opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Emails.retrieve_email_events(client, "id")
Retrieve Email Stats
Returns aggregated daily sending statistics for the current period.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Emails.retrieve_email_stats(client)
Send Bulk Emails
Send up to 20 emails in a single request. Use fallback to set default values shared across all messages.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.body— application/json request body usingCreateBulkEmailsRequest. Accepted fields:"fallback"(CreateBulkFallback map, optional) — Used as a fallback field email value if no value is present in emails."emails"(list of CreateBulkEmail map, required) — The bulk emails to send.
opts— Optional keyword list passed to Req for this request."Idempotency-Key"— Optional header, string. Unique key to ensure the request is processed at most once. UUIDv4 recommended.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Emails.send_bulk_emails(
client,
%{
"emails" => [
%{
"from" => "Tomlinson AI <ray@info.tomlinson.ai>"
}
]
},
headers: [{"Idempotency-Key", "idempotency-key"}]
)
Send Email
Send transactional emails through Nuntly platform. It supports HTML and plain-text emails, attachments, labels, custom headers and scheduling.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.body— application/json request body usingCreateEmailRequest. Accepted fields:"from"(string, required) — The e-mail address of the sender"to"(list of string or string, required) — The primary recipient(s) of the email"cc"(list of string or string, optional) — The carbon copy recipient(s) of the email"bcc"(list of string or string, optional) — The blind carbon copy recipient(s) of the email"replyTo"(list of string or string, optional) — The email address where replies should be sent. If a recipient replies, the response will go to this address instead of the sender's email address"subject"(string, required) — The subject of the e-mail"text"(string, optional) — The plaintext version of the email"html"(string, optional) — The HTML version of the email"headers"(map, optional) — The headers to add to the email"tags"(list of Tag map, optional) — The tags to add to the email"attachments"(list of Attachment map, optional) — The attachements to add to the email"variables"(map, optional) — The variables for the template"scheduledAt"(string, optional) — The date at which the email is scheduled to be sent
opts— Optional keyword list passed to Req for this request."Idempotency-Key"— Optional header, string. Unique key to ensure the request is processed at most once. UUIDv4 recommended.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Emails.send_email(
client,
%{
"from" => "Tomlinson AI <ray@info.tomlinson.ai>",
"to" => "brian67@gmail.com",
"subject" => "Verify your email address"
},
headers: [{"Idempotency-Key", "idempotency-key"}]
)