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.
1079 1080 1081 |
# File 'lib/mandrill/api.rb', line 1079 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
1077 1078 1079 |
# File 'lib/mandrill/api.rb', line 1077 def master @master end |
Instance Method Details
#add(id, name = nil, notes = nil, custom_quota = nil) ⇒ Hash
Add a new subaccount
1118 1119 1120 1121 |
# File 'lib/mandrill/api.rb', line 1118 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.
1189 1190 1191 1192 |
# File 'lib/mandrill/api.rb', line 1189 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
1150 1151 1152 1153 |
# File 'lib/mandrill/api.rb', line 1150 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
1097 1098 1099 1100 |
# File 'lib/mandrill/api.rb', line 1097 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.
1207 1208 1209 1210 |
# File 'lib/mandrill/api.rb', line 1207 def pause(id) _params = {:id => id} return @master.call 'subaccounts/pause', _params end |
#resume(id) ⇒ Hash
Resume a paused subaccount’s sending
1225 1226 1227 1228 |
# File 'lib/mandrill/api.rb', line 1225 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
1171 1172 1173 1174 |
# File 'lib/mandrill/api.rb', line 1171 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 |