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.
1446 1447 1448 |
# File 'lib/mandrill/api.rb', line 1446 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
1444 1445 1446 |
# File 'lib/mandrill/api.rb', line 1444 def master @master end |
Instance Method Details
#add(id, name = nil, notes = nil, custom_quota = nil) ⇒ Hash
Add a new subaccount
1485 1486 1487 1488 |
# File 'lib/mandrill/api.rb', line 1485 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.
1556 1557 1558 1559 |
# File 'lib/mandrill/api.rb', line 1556 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
1517 1518 1519 1520 |
# File 'lib/mandrill/api.rb', line 1517 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
1464 1465 1466 1467 |
# File 'lib/mandrill/api.rb', line 1464 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.
1574 1575 1576 1577 |
# File 'lib/mandrill/api.rb', line 1574 def pause(id) _params = {:id => id} return @master.call 'subaccounts/pause', _params end |
#resume(id) ⇒ Hash
Resume a paused subaccount’s sending
1592 1593 1594 1595 |
# File 'lib/mandrill/api.rb', line 1592 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
1538 1539 1540 1541 |
# File 'lib/mandrill/api.rb', line 1538 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 |