Class: Sendgrid::Newsletter::List
- Inherits:
-
Base
- Object
- Base
- Sendgrid::Newsletter::List
show all
- Defined in:
- lib/sendgrid-newsletter/list.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/list.rb', line 6
def add(options={})
check_required_params options, [:list]
response = self.class.post '/lists/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/list.rb', line 13
def delete(options={})
check_required_params options, [:list]
response = self.class.post '/lists/delete.json', body: options
raise APIError.new(response['error']) if response['error']
response
end
|