Class: Mandrill::Rejects

Inherits:
Object
  • Object
show all
Defined in:
lib/mandrill/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(master) ⇒ Rejects

Returns a new instance of Rejects.



264
265
266
# File 'lib/mandrill/api.rb', line 264

def initialize(master)
    @master = master
end

Instance Attribute Details

#masterObject

Returns the value of attribute master.



262
263
264
# File 'lib/mandrill/api.rb', line 262

def master
  @master
end

Instance Method Details

#delete(email) ⇒ Hash

Deletes an email rejection. There is no limit to how many rejections you can remove from your blacklist, but keep in mind that each deletion has an affect on your reputation.

Parameters:

  • email (String)

    an email address

Returns:

  • (Hash)

    a status object containing the address and whether the deletion succeeded.

    • String

      email the email address that was removed from the blacklist

    • Boolean

      deleted whether the address was deleted successfully.



289
290
291
292
# File 'lib/mandrill/api.rb', line 289

def delete(email)
    _params = {:email => email}
    return @master.call 'rejects/delete', _params
end

#list(email = nil, include_expired = false) ⇒ Array

Retrieves your email rejection blacklist. You can provide an email address to limit the results. Returns up to 1000 results. By default, entries that have expired are excluded from the results; set include_expired to true to include them.

Parameters:

  • email (String) (defaults to: nil)

    an optional email address to search by

  • include_expired (Boolean) (defaults to: false)

    whether to include rejections that have already expired.

Returns:

  • (Array)

    Up to 1000 rejection entries

    • Hash

      return[] the information for each rejection blacklist entry

      - [String] email the email that is blocked
      - [String] reason the type of event (hard-bounce, soft-bounce, spam, unsub) that caused this rejection
      - [String] created_at when the email was added to the blacklist
      - [String] expires_at when the blacklist entry will expire (this may be in the past)
      - [Boolean] expired whether the blacklist entry has expired
      - [Hash] Sender sender the sender that this blacklist entry applies to, or null if none.
      


279
280
281
282
# File 'lib/mandrill/api.rb', line 279

def list(email=nil, include_expired=false)
    _params = {:email => email, :include_expired => include_expired}
    return @master.call 'rejects/list', _params
end