Module: Mailblastr::Audiences
- Defined in:
- lib/mailblastr/audiences.rb
Class Method Summary collapse
-
.create(params) ⇒ Object
POST /audiences — params: { name: "..." }.
-
.delete(audience_id) ⇒ Object
DELETE /audiences/:id.
-
.get(audience_id) ⇒ Object
GET /audiences/:id.
-
.import_sheet(audience_id, params) ⇒ Object
Import contacts from a link-shared Google Sheet; header columns become contact properties and rows land in a fresh segment.
-
.list(params = {}) ⇒ Object
GET /audiences.
-
.update(audience_id, params) ⇒ Object
Rename an audience.
Class Method Details
.create(params) ⇒ Object
POST /audiences — params: { name: "..." }
7 8 9 |
# File 'lib/mailblastr/audiences.rb', line 7 def create(params) Client.request(:post, "/audiences", body: params) end |
.delete(audience_id) ⇒ Object
DELETE /audiences/:id
27 28 29 |
# File 'lib/mailblastr/audiences.rb', line 27 def delete(audience_id) Client.request(:delete, "/audiences/#{Client.path_escape(audience_id)}") end |
.get(audience_id) ⇒ Object
GET /audiences/:id
12 13 14 |
# File 'lib/mailblastr/audiences.rb', line 12 def get(audience_id) Client.request(:get, "/audiences/#{Client.path_escape(audience_id)}") end |
.import_sheet(audience_id, params) ⇒ Object
Import contacts from a link-shared Google Sheet; header columns become contact properties and rows land in a fresh segment. POST /audiences/:id/contacts/import-sheet — params: { url:, segment_name: }
34 35 36 |
# File 'lib/mailblastr/audiences.rb', line 34 def import_sheet(audience_id, params) Client.request(:post, "/audiences/#{Client.path_escape(audience_id)}/contacts/import-sheet", body: params) end |
.list(params = {}) ⇒ Object
GET /audiences
17 18 19 |
# File 'lib/mailblastr/audiences.rb', line 17 def list(params = {}) Client.request(:get, "/audiences", query: Client.pagination(params)) end |
.update(audience_id, params) ⇒ Object
Rename an audience. PATCH /audiences/:id
22 23 24 |
# File 'lib/mailblastr/audiences.rb', line 22 def update(audience_id, params) Client.request(:patch, "/audiences/#{Client.path_escape(audience_id)}", body: params) end |