Class: Sendgrid::Web::Bounces

Inherits:
Client
  • Object
show all
Defined in:
lib/sendgrid/web/bounces.rb

Instance Method Summary collapse

Methods inherited from Client

base_uri, config, #config, configure

Instance Method Details

#delete(start_date: nil, end_date: nil, type: nil, email: nil) ⇒ Sendgrid::Web::Response

Note:

All parameters are optional

Note:

If no parameters are specified the ENTIRE list will be deleted.

Delete an address from the Bounce list.

Parameters:

  • start_date (DateTime) (defaults to: nil)

    Optional date to start deleting from.

  • end_date (DateTime) (defaults to: nil)

    Optional date to end deleting from.

  • type (String) (defaults to: nil)

    Choose the type of bounce to be removed. Can be either hard or soft.

  • email (String) (defaults to: nil)

    Email bounce address to remove.

Returns:



52
53
54
55
56
57
58
59
60
61
62
# File 'lib/sendgrid/web/bounces.rb', line 52

def delete(
  start_date: nil, end_date: nil, type: nil,
  email: nil)
  res = connection.post('/api/bounces.delete.json',
    default_params(
      start_date: start_date,
      end_date: end_date,
      type: type,
      email: email))
  craft_response(res)
end

#get(date: nil, days: nil, start_date: nil, end_date: nil, limit: nil, offset: nil, type: nil, email: nil) ⇒ Sendgrid::Web::Response

Note:

All parameters are optional

Retrieve a list of bounces with addresses and response codes, optionally with dates.

Parameters:

  • date (Integer) (defaults to: nil)

    Retrieve the timestamp of the bounce records.

  • days (Integer) (defaults to: nil)

    Number of days in the past for which to retrieve bounces (includes today)

  • start_date (DateTime) (defaults to: nil)

    The start of the date range for which to retrieve bounces.

  • end_date (DateTime) (defaults to: nil)

    The end of the date range for which to retrieve bounces.

  • limit (Integer) (defaults to: nil)

    Optional field to limit the number of results returned.

  • offset (Integer) (defaults to: nil)

    Optional beginning point in the list to retrieve from.

  • type (String) (defaults to: nil)

    Choose the type of bounce to search for. Can be either hard or soft.

  • email (String) (defaults to: nil)

    Optional email addresses to search for.

Returns:



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/sendgrid/web/bounces.rb', line 23

def get(
  date: nil, days: nil, start_date: nil,
  end_date: nil, limit: nil, offset: nil,
  type: nil, email: nil)
  res = connection.post(
    '/api/bounces.get.json',
    default_params(
      date: date,
      days: days,
      start_date: start_date,
      end_date: end_date,
      limit: limit,
      offset: offset,
      type: type,
      email: email))
  craft_response(res)
end