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



427
428
429
# File 'lib/mandrill/api.rb', line 427

def initialize(master)
    @master = master
end

Instance Attribute Details

#masterObject

Returns the value of attribute master.



425
426
427
# File 'lib/mandrill/api.rb', line 425

def master
  @master
end

Instance Method Details

#add(email, comment = nil, subaccount = nil) ⇒ Hash

Adds an email to your email rejection blacklist. Addresses that you add manually will never expire and there is no reputation penalty for removing them from your blacklist. Attempting to blacklist an address that has been whitelisted will have no effect.



438
439
440
441
# File 'lib/mandrill/api.rb', line 438

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

#delete(email, subaccount = nil) ⇒ 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.



482
483
484
485
# File 'lib/mandrill/api.rb', line 482

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

#list(email = nil, include_expired = false, subaccount = nil) ⇒ 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.



470
471
472
473
# File 'lib/mandrill/api.rb', line 470

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