Class: Sendgrid::API::Newsletter::Recipients::Services

Inherits:
Service
  • Object
show all
Includes:
Utils
Defined in:
lib/sendgrid/api/newsletter/recipients.rb

Instance Attribute Summary

Attributes inherited from Service

#resource

Instance Method Summary collapse

Methods inherited from Service

#initialize, #perform_request

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.

Parameters:

Returns:

See Also:



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.

Parameters:

Returns:

See Also:



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.

Parameters:

Returns:

See Also:



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