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