Access received messages, download attachments, and send replies or forwards from an inbox.
Summary
Functions
Forward Message
List Message Attachments
List Messages
Reply To Message
Retrieve Message
Retrieve Message Attachment
Retrieve Message Content
Update Message
Functions
Forward Message
Forward a message to new recipients.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.message_id— Required path parameter, string. The RFC 5322 Message-ID header.body— application/json request body usingForwardMessageRequest. Accepted fields:"to"(list of string, required) — The recipient addresses to forward to."text"(string, optional) — An optional comment to prepend.
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.Messages.forward_message(
client,
"message-id",
%{
"to" => "brian67@gmail.com"
},
headers: [{"Idempotency-Key", "idempotency-key"}]
)
List Message Attachments
List all attachments for a message.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.message_id— Required path parameter, string.opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Messages.list_message_attachments(client, "message-id")
List Messages
List all received messages across inboxes.
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."domainId"— Optional query parameter, string. Filter by domain."from"— Optional query parameter, string. Filter by sender address.
opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Messages.list_messages(
client,
%{
"cursor" => "cursor",
"limit" => 30,
"domainId" => "domain-id",
"from" => "from"
}
)
Reply To Message
Reply to a message. Set replyAll to true to reply to all recipients.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.message_id— Required path parameter, string. The RFC 5322 Message-ID header.body— application/json request body usingReplyMessageRequest. Accepted fields:"text"(string, optional) — The plain text body."html"(string, optional) — The HTML body."replyAll"(boolean, required) — Whether to reply to all recipients.
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.Messages.reply_to_message(
client,
"message-id",
%{
"replyAll" => true
},
headers: [{"Idempotency-Key", "idempotency-key"}]
)
Retrieve Message
Retrieve a single message with inbox enrichment.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.message_id— Required path parameter, string. The email Message-ID header.opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Messages.retrieve_message(client, "message-id")
Retrieve Message Attachment
Retrieve an attachment with a presigned download URL.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.message_id— Required path parameter, string.attachment_id— Required path parameter, string.opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Messages.retrieve_message_attachment(client, "message-id", "attachment-id")
Retrieve Message Content
Returns presigned URLs to download the HTML, plain-text, and raw MIME source of a received message.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.message_id— Required path parameter, string.opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Messages.retrieve_message_content(client, "message-id")
Update Message
Update message labels. Only available for messages in user-created inboxes.
Arguments
client— ANuntly.Clientreturned byNuntly.new/1.message_id— Required path parameter, string.body— application/json request body usingUpdateMessageRequest. Accepted fields:"addLabels"(list of string, optional) — Labels to add to the message."removeLabels"(list of string, optional) — Labels to remove from the message.
opts— Optional keyword list passed to Req for this request.
Example
client = Nuntly.new(api_key: "ntly_...")
Nuntly.Messages.update_message(
client,
"message-id",
%{
"addLabels" => ["add-label"]
}
)