Class: Sendgrid::API::Newsletter::Recipients::Services
- Includes:
- Utils
- Defined in:
- lib/sendgrid/api/newsletter/recipients.rb
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#add(list, marketing_email) ⇒ Entities::Response
Assign a List to a Marketing Email.
-
#delete(list, marketing_email) ⇒ Entities::Response
Remove assigned lists from Marketing Email.
-
#get(marketing_email) ⇒ Array<Entities::List>
Get all lists assigned to a particular Marketing Email.
Methods inherited from Service
Constructor Details
This class inherits a constructor from Sendgrid::API::Service
Instance Method Details
#add(list, marketing_email) ⇒ Entities::Response
Assign a List to a Marketing Email.
24 25 26 27 |
# File 'lib/sendgrid/api/newsletter/recipients.rb', line 24 def add(list, marketing_email) params = { :list => extract_listname(list), :name => extract_marketing_email(marketing_email) } perform_request(Entities::Response, 'newsletter/recipients/add.json', params) end |
#delete(list, marketing_email) ⇒ Entities::Response
Remove assigned lists from Marketing Email.
45 46 47 48 |
# File 'lib/sendgrid/api/newsletter/recipients.rb', line 45 def delete(list, marketing_email) params = { :list => extract_listname(list), :name => extract_marketing_email(marketing_email) } perform_request(Entities::Response, 'newsletter/recipients/delete.json', params) end |
#get(marketing_email) ⇒ Array<Entities::List>
Get all lists assigned to a particular Marketing Email.
34 35 36 37 |
# File 'lib/sendgrid/api/newsletter/recipients.rb', line 34 def get(marketing_email) params = { :name => extract_marketing_email(marketing_email) } perform_request(Entities::List, 'newsletter/recipients/get.json', params) end |