Sendio.Emails (sendio v1.1.0)
Send emails via send.io.
Summary
Functions
Cancels a scheduled email.
Gets an email given an ID.
Gets a specific attachment for an email.
Lists all sent emails.
Lists all attachments for an email.
Sends an email given a map of parameters.
Sends a batch of emails (up to 100).
Updates a scheduled email.
Functions
cancel(client \\ Sendio.client(), email_id)
@spec cancel(Sendio.Client.t(), String.t()) :: Sendio.Client.response(Sendio.Emails.Email.t())
Cancels a scheduled email.
get(client \\ Sendio.client(), email_id)
@spec get(Sendio.Client.t(), String.t()) :: Sendio.Client.response(Sendio.Emails.Email.t())
Gets an email given an ID.
get_attachment(client \\ Sendio.client(), email_id, attachment_id)
@spec get_attachment(Sendio.Client.t(), String.t(), String.t()) :: Sendio.Client.response(Sendio.Emails.Attachment.t())
Gets a specific attachment for an email.
list(client \\ Sendio.client())
@spec list(Sendio.Client.t()) :: Sendio.Client.response(Sendio.List.t(Sendio.Emails.Email.t()))
Lists all sent emails.
list_attachments(client \\ Sendio.client(), email_id)
@spec list_attachments(Sendio.Client.t(), String.t()) :: Sendio.Client.response(Sendio.List.t(Sendio.Emails.Attachment.t()))
Lists all attachments for an email.
send(opts)
@spec send(map()) :: Sendio.Client.response(Sendio.Emails.Email.t())
Sends an email given a map of parameters.
Parameter options:
:to- Recipient email address (required):from- Sender email address (required):cc- Additional email addresses to copy, may be a single address or a list of addresses:bcc- Additional email addresses to blind-copy, may be a single address or a list of addresses:reply_to- Specify the email that recipients will reply to:subject- Subject line of the email:headers- Map of headers to add to the email with corresponding string values:html- The HTML-formatted body of the email:text- The text-formatted body of the email:attachments- List of attachments to include in the email:tags- List of tags to add to the email:scheduled_at- Schedule the email to be sent at a specific time (ISO 8601 string):topic_id- The topic ID for subscription-based sending:template- Template object with:idand optional:variablesmap for template-based emails
You must include one or both of the :html and :text options, unless using a template.
Request options (an optional keyword list after the parameters):
:idempotency_key- Sent as theIdempotency-Keyheader. Retrying with the same key returns the first result instead of sending the email again.Sendio.Emails.send(params, idempotency_key: "welcome-user/123") Sendio.Emails.send(client, params, idempotency_key: "welcome-user/123")
send(client, opts)
@spec send(Sendio.Client.t(), map()) :: Sendio.Client.response(Sendio.Emails.Email.t())
@spec send(map(), Keyword.t()) :: Sendio.Client.response(Sendio.Emails.Email.t())
send(client, opts, request_opts)
@spec send(Sendio.Client.t(), map(), Keyword.t()) :: Sendio.Client.response(Sendio.Emails.Email.t())
send_batch(emails)
@spec send_batch([map()]) :: Sendio.Client.response(Sendio.Emails.BatchResponse.t())
Sends a batch of emails (up to 100).
Takes a list of email parameter maps, each with the same options as send/2, and the
same request options (:idempotency_key) as send/3.
Sendio.Emails.send_batch(emails, idempotency_key: "digest/2026-10-08")
send_batch(client, emails)
@spec send_batch(Sendio.Client.t(), [map()]) :: Sendio.Client.response(Sendio.Emails.BatchResponse.t())
@spec send_batch([map()], Keyword.t()) :: Sendio.Client.response(Sendio.Emails.BatchResponse.t())
send_batch(client, emails, request_opts)
@spec send_batch(Sendio.Client.t(), [map()], Keyword.t()) :: Sendio.Client.response(Sendio.Emails.BatchResponse.t())
update(client \\ Sendio.client(), email_id, opts)
@spec update(Sendio.Client.t(), String.t(), Keyword.t()) :: Sendio.Client.response(Sendio.Emails.Email.t())
Updates a scheduled email.
Options
:scheduled_at- The new scheduled time (ISO 8601 string)