Class: Sendgrid::Newsletter::Recipient
- Inherits:
-
Base
- Object
- Base
- Sendgrid::Newsletter::Recipient
show all
- Defined in:
- lib/sendgrid-newsletter/recipient.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#add(options = {}) ⇒ Object
6
7
8
9
10
11
|
# File 'lib/sendgrid-newsletter/recipient.rb', line 6
def add(options={})
check_required_params options, [:name, :list]
response = self.class.post '/recipients/add.json', body: options
raise APIError.new(response['error']) if response['error']
response
end
|
#delete(options = {}) ⇒ Object
13
14
15
16
17
18
|
# File 'lib/sendgrid-newsletter/recipient.rb', line 13
def delete(options={})
check_required_params options, [:name, :list]
response = self.class.post '/recipients/delete.json', body: options
raise APIError.new(response['error']) if response['error']
response
end
|