Class: Sendgrid::Web::Blocks
- Defined in:
- lib/sendgrid/web/blocks.rb
Instance Method Summary collapse
-
#delete(email: nil) ⇒ Sendgrid::Web::Response
Deletes all blocks associated with the provided email.
-
#get(date: nil, days: nil, start_date: nil, end_date: nil, limit: nil, offset: nil) ⇒ Sendgrid::Web::Response
Retrieves a list of all blocked email addresses along with the reason why they are blocked.
Methods inherited from Client
base_uri, config, #config, configure
Instance Method Details
#delete(email: nil) ⇒ Sendgrid::Web::Response
Deletes all blocks associated with the provided email
38 39 40 41 42 43 44 45 46 |
# File 'lib/sendgrid/web/blocks.rb', line 38 def delete(email: nil) if email.nil? raise ArgumentError.new('Missing required `email` option') end res = connection.post( '/api/blocks.delete.json', default_params(email: email)) craft_response(res) end |
#get(date: nil, days: nil, start_date: nil, end_date: nil, limit: nil, offset: nil) ⇒ Sendgrid::Web::Response
Note:
All parameters are optional
Retrieves a list of all blocked email addresses along with the reason why they are blocked.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/sendgrid/web/blocks.rb', line 19 def get( date: nil, days: nil, start_date: nil, end_date: nil, limit: nil, offset: nil) res = connection.post( '/api/blocks.get.json', default_params( date: date, days: days, start_date: start_date, end_date: end_date, limit: limit, offset: offset)) craft_response(res) end |