Module: Resend::Contacts
- Defined in:
- lib/resend/contacts.rb
Overview
Contacts api wrapper
Class Method Summary collapse
- .create(params) ⇒ Object
- .get(audience_id, id) ⇒ Object
- .list(audience_id) ⇒ Object
-
.remove(audience_id, contact_id) ⇒ Object
Remove a contact from an audience.
- .update(params) ⇒ Object
Class Method Details
.create(params) ⇒ Object
11 12 13 14 |
# File 'lib/resend/contacts.rb', line 11 def create(params) path = "audiences/#{params[:audience_id]}/contacts" Resend::Request.new(path, params, "post").perform end |
.get(audience_id, id) ⇒ Object
17 18 19 20 |
# File 'lib/resend/contacts.rb', line 17 def get(audience_id, id) path = "audiences/#{audience_id}/contacts/#{id}" Resend::Request.new(path, {}, "get").perform end |
.list(audience_id) ⇒ Object
23 24 25 26 |
# File 'lib/resend/contacts.rb', line 23 def list(audience_id) path = "audiences/#{audience_id}/contacts" Resend::Request.new(path, {}, "get").perform end |
.remove(audience_id, contact_id) ⇒ Object
Remove a contact from an audience
see also: resend.com/docs/api-reference/contacts/delete-contact
35 36 37 38 |
# File 'lib/resend/contacts.rb', line 35 def remove(audience_id, contact_id) path = "audiences/#{audience_id}/contacts/#{contact_id}" Resend::Request.new(path, {}, "delete").perform end |