Class: Mandrill::Subaccounts
- Inherits:
-
Object
- Object
- Mandrill::Subaccounts
- Defined in:
- lib/mandrill/api.rb
Instance Attribute Summary collapse
-
#master ⇒ Object
Returns the value of attribute master.
Instance Method Summary collapse
-
#add(id, name = nil, notes = nil, custom_quota = nil) ⇒ Hash
Add a new subaccount.
-
#delete(id) ⇒ Hash
Delete an existing subaccount.
-
#info(id) ⇒ Hash
Given the ID of an existing subaccount, return the data about it.
-
#initialize(master) ⇒ Subaccounts
constructor
A new instance of Subaccounts.
-
#list(q = nil) ⇒ Array
Get the list of subaccounts defined for the account, optionally filtered by a prefix.
-
#pause(id) ⇒ Hash
Pause a subaccount’s sending.
-
#resume(id) ⇒ Hash
Resume a paused subaccount’s sending.
-
#update(id, name = nil, notes = nil, custom_quota = nil) ⇒ Hash
Update an existing subaccount.
Constructor Details
#initialize(master) ⇒ Subaccounts
Returns a new instance of Subaccounts.
1291 1292 1293 |
# File 'lib/mandrill/api.rb', line 1291 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
1289 1290 1291 |
# File 'lib/mandrill/api.rb', line 1289 def master @master end |
Instance Method Details
#add(id, name = nil, notes = nil, custom_quota = nil) ⇒ Hash
Add a new subaccount
1330 1331 1332 1333 |
# File 'lib/mandrill/api.rb', line 1330 def add(id, name=nil, notes=nil, custom_quota=nil) _params = {:id => id, :name => name, :notes => notes, :custom_quota => custom_quota} return @master.call 'subaccounts/add', _params end |
#delete(id) ⇒ Hash
Delete an existing subaccount. Any email related to the subaccount will be saved, but stats will be removed and any future sending calls to this subaccount will fail.
1401 1402 1403 1404 |
# File 'lib/mandrill/api.rb', line 1401 def delete(id) _params = {:id => id} return @master.call 'subaccounts/delete', _params end |
#info(id) ⇒ Hash
Given the ID of an existing subaccount, return the data about it
1362 1363 1364 1365 |
# File 'lib/mandrill/api.rb', line 1362 def info(id) _params = {:id => id} return @master.call 'subaccounts/info', _params end |
#list(q = nil) ⇒ Array
Get the list of subaccounts defined for the account, optionally filtered by a prefix
1309 1310 1311 1312 |
# File 'lib/mandrill/api.rb', line 1309 def list(q=nil) _params = {:q => q} return @master.call 'subaccounts/list', _params end |
#pause(id) ⇒ Hash
Pause a subaccount’s sending. Any future emails delivered to this subaccount will be queued for a maximum of 3 days until the subaccount is resumed.
1419 1420 1421 1422 |
# File 'lib/mandrill/api.rb', line 1419 def pause(id) _params = {:id => id} return @master.call 'subaccounts/pause', _params end |
#resume(id) ⇒ Hash
Resume a paused subaccount’s sending
1437 1438 1439 1440 |
# File 'lib/mandrill/api.rb', line 1437 def resume(id) _params = {:id => id} return @master.call 'subaccounts/resume', _params end |
#update(id, name = nil, notes = nil, custom_quota = nil) ⇒ Hash
Update an existing subaccount
1383 1384 1385 1386 |
# File 'lib/mandrill/api.rb', line 1383 def update(id, name=nil, notes=nil, custom_quota=nil) _params = {:id => id, :name => name, :notes => notes, :custom_quota => custom_quota} return @master.call 'subaccounts/update', _params end |