Module: Mailblastr::Emails::Receiving
- Defined in:
- lib/mailblastr/emails.rb
Overview
Inbound (received) email.
Class Method Summary collapse
-
.delete(email_id) ⇒ Object
Delete a received email.
-
.forward(email_id, params) ⇒ Object
Forward a received email.
-
.get(email_id) ⇒ Object
Retrieve a received email.
-
.get_attachment(email_id, attachment_id) ⇒ Object
Download one attachment as raw bytes (binary String).
-
.list(params = {}) ⇒ Object
List received emails — cursor pagination plus an optional
received_forfilter (only messages received for that address). -
.list_attachments(email_id) ⇒ Object
List a received email's attachments.
-
.raw(email_id) ⇒ Object
Download the original RFC822/MIME message as raw bytes (binary String).
-
.reply(email_id, params) ⇒ Object
Reply to a received email's sender, threaded into the conversation.
Class Method Details
.delete(email_id) ⇒ Object
Delete a received email. DELETE /emails/receiving/:id
112 113 114 |
# File 'lib/mailblastr/emails.rb', line 112 def delete(email_id) Client.request(:delete, "/emails/receiving/#{Client.path_escape(email_id)}") end |
.forward(email_id, params) ⇒ Object
Forward a received email. POST /emails/receiving/:id/forward Receiving.forward(id, { from: "you@yourdomain.com", to: "team@you.com" })
101 102 103 |
# File 'lib/mailblastr/emails.rb', line 101 def forward(email_id, params) Client.request(:post, "/emails/receiving/#{Client.path_escape(email_id)}/forward", body: params) end |
.get(email_id) ⇒ Object
Retrieve a received email. GET /emails/receiving/:id
74 75 76 |
# File 'lib/mailblastr/emails.rb', line 74 def get(email_id) Client.request(:get, "/emails/receiving/#{Client.path_escape(email_id)}") end |
.get_attachment(email_id, attachment_id) ⇒ Object
Download one attachment as raw bytes (binary String). GET /emails/receiving/:id/attachments/:attachment_id
85 86 87 88 89 90 91 |
# File 'lib/mailblastr/emails.rb', line 85 def (email_id, ) Client.request( :get, "/emails/receiving/#{Client.path_escape(email_id)}/attachments/#{Client.path_escape()}", raw: true ) end |
.list(params = {}) ⇒ Object
List received emails — cursor pagination plus an optional
received_for filter (only messages received for that address).
GET /emails/receiving
66 67 68 69 70 71 |
# File 'lib/mailblastr/emails.rb', line 66 def list(params = {}) query = Client.pagination(params) received_for = Client.opt(params, :received_for) query[:received_for] = received_for unless received_for.nil? Client.request(:get, "/emails/receiving", query: query) end |
.list_attachments(email_id) ⇒ Object
List a received email's attachments. GET /emails/receiving/:id/attachments
79 80 81 |
# File 'lib/mailblastr/emails.rb', line 79 def (email_id) Client.request(:get, "/emails/receiving/#{Client.path_escape(email_id)}/attachments") end |
.raw(email_id) ⇒ Object
Download the original RFC822/MIME message as raw bytes (binary String). GET /emails/receiving/:id/raw
95 96 97 |
# File 'lib/mailblastr/emails.rb', line 95 def raw(email_id) Client.request(:get, "/emails/receiving/#{Client.path_escape(email_id)}/raw", raw: true) end |
.reply(email_id, params) ⇒ Object
Reply to a received email's sender, threaded into the conversation. POST /emails/receiving/:id/reply
107 108 109 |
# File 'lib/mailblastr/emails.rb', line 107 def reply(email_id, params) Client.request(:post, "/emails/receiving/#{Client.path_escape(email_id)}/reply", body: params) end |