Module: EmailFuse::Emails
- Included in:
- Client
- Defined in:
- lib/email_fuse/emails.rb,
lib/email_fuse/emails/receiving.rb,
lib/email_fuse/emails/attachments.rb,
lib/email_fuse/emails/receiving/attachments.rb
Overview
Module responsible for wrapping email sending API
Defined Under Namespace
Modules: Attachments, Receiving
Class Method Summary collapse
-
.cancel(email_id = "") ⇒ Object
Cancel a scheduled email.
-
.get(email_id = "") ⇒ Object
Retrieve a single email.
-
.list(options = {}) ⇒ Object
List emails with optional pagination.
-
.send(params, options: {}) ⇒ Object
Sends or schedules an email.
-
.update(params) ⇒ Object
Update a scheduled email.
Class Method Details
.cancel(email_id = "") ⇒ Object
Cancel a scheduled email. see more: resend.com/docs/api-reference/emails/cancel-email
30 31 32 33 |
# File 'lib/email_fuse/emails.rb', line 30 def cancel(email_id = "") path = "emails/#{email_id}/cancel" EmailFuse::Request.new(path, {}, "post").perform end |
.get(email_id = "") ⇒ Object
Retrieve a single email. see more: resend.com/docs/api-reference/emails/retrieve-email
16 17 18 19 |
# File 'lib/email_fuse/emails.rb', line 16 def get(email_id = "") path = "emails/#{email_id}" EmailFuse::Request.new(path, {}, "get").perform end |
.list(options = {}) ⇒ Object
List emails with optional pagination. see more: resend.com/docs/api-reference/emails/list-emails
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/email_fuse/emails.rb', line 42 def list( = {}) path = "emails" # Build query parameters, filtering out nil values query_params = {} query_params[:limit] = [:limit] if [:limit] query_params[:after] = [:after] if [:after] query_params[:before] = [:before] if [:before] EmailFuse::Request.new(path, query_params, "get").perform end |
.send(params, options: {}) ⇒ Object
Sends or schedules an email. see more: resend.com/docs/api-reference/emails/send-email
9 10 11 12 |
# File 'lib/email_fuse/emails.rb', line 9 def send(params, options: {}) path = "emails" EmailFuse::Request.new(path, params, "post", options: ).perform end |
.update(params) ⇒ Object
Update a scheduled email. see more: resend.com/docs/api-reference/emails/update-email
23 24 25 26 |
# File 'lib/email_fuse/emails.rb', line 23 def update(params) path = "emails/#{params[:email_id]}" EmailFuse::Request.new(path, params, "patch").perform end |