# Class Mandrill_Subaccounts

Located at Mandrill/Subaccounts.php

Methods summary
`public` | # `__construct( `Mandrill` $master )`

`public array`

# `getList( string $q = null )`

Get the list of subaccounts defined for the account, optionally filtered by a prefix

Get the list of subaccounts defined for the account, optionally filtered by a prefix

#### Parameters

$q
  `string`
  $q an optional prefix to filter the subaccounts' ids and names

#### Returns

`array`
the subaccounts for the account, up to a maximum of 1,000 - return[] struct the individual subaccount info - id string a unique indentifier for the subaccount - name string an optional display name for the subaccount - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation - status string the current sending status of the subaccount, one of "active" or "paused" - reputation integer the subaccount's current reputation on a scale from 0 to 100 - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC) - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC) - sent_total integer the number of emails the subaccount has sent since it was created

`public struct`

# `add( string $id, string $name = null, string $notes = null, integer $custom_quota = null )`

Add a new subaccount

Add a new subaccount

#### Parameters

$id
  `string`
  $id a unique identifier for the subaccount to be used in sending calls
$name
  `string`
  $name an optional display name to further identify the subaccount
$notes
  `string`
  $notes optional extra text to associate with the subaccount
$custom_quota
  `integer`
  $custom_quota an optional manual hourly quota for the subaccount. If not specified, Mandrill will manage this based on reputation

#### Returns

`struct`
the information saved about the new subaccount - id string a unique indentifier for the subaccount - name string an optional display name for the subaccount - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation - status string the current sending status of the subaccount, one of "active" or "paused" - reputation integer the subaccount's current reputation on a scale from 0 to 100 - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC) - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC) - sent_total integer the number of emails the subaccount has sent since it was created

`public struct`

# `info( string $id )`

Given the ID of an existing subaccount, return the data about it

Given the ID of an existing subaccount, return the data about it

#### Parameters

$id
  `string`
  $id the unique identifier of the subaccount to query

#### Returns

`struct`
the information about the subaccount - id string a unique indentifier for the subaccount - name string an optional display name for the subaccount - notes string optional extra text to associate with the subaccount - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation - status string the current sending status of the subaccount, one of "active" or "paused" - reputation integer the subaccount's current reputation on a scale from 0 to 100 - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC) - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC) - sent_total integer the number of emails the subaccount has sent since it was created - sent_hourly integer the number of emails the subaccount has sent in the last hour - hourly_quota integer the current hourly quota for the subaccount, either manual or reputation-based - last30_days struct stats for this subaccount in the last 30 days - sent integer the number of emails sent for this subaccount in the last 30 days - hard_bounces integer the number of emails hard bounced for this subaccount in the last 30 days - soft_bounces integer the number of emails soft bounced for this subaccount in the last 30 days - rejects integer the number of emails rejected for sending this subaccount in the last 30 days - complaints integer the number of spam complaints for this subaccount in the last 30 days - unsubs integer the number of unsbuscribes for this subaccount in the last 30 days - opens integer the number of times emails have been opened for this subaccount in the last 30 days - unique_opens integer the number of unique opens for emails sent for this subaccount in the last 30 days - clicks integer the number of URLs that have been clicked for this subaccount in the last 30 days - unique_clicks integer the number of unique clicks for emails sent for this subaccount in the last 30 days

`public struct`

# `update( string $id, string $name = null, string $notes = null, integer $custom_quota = null )`

Update an existing subaccount

Update an existing subaccount

#### Parameters

$id
  `string`
  $id the unique identifier of the subaccount to update
$name
  `string`
  $name an optional display name to further identify the subaccount
$notes
  `string`
  $notes optional extra text to associate with the subaccount
$custom_quota
  `integer`
  $custom_quota an optional manual hourly quota for the subaccount. If not specified, Mandrill will manage this based on reputation

#### Returns

`struct`
the information for the updated subaccount - id string a unique indentifier for the subaccount - name string an optional display name for the subaccount - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation - status string the current sending status of the subaccount, one of "active" or "paused" - reputation integer the subaccount's current reputation on a scale from 0 to 100 - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC) - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC) - sent_total integer the number of emails the subaccount has sent since it was created

`public struct`

# `delete( string $id )`

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.

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.

#### Parameters

$id
  `string`
  $id the unique identifier of the subaccount to delete

#### Returns

`struct`
the information for the deleted subaccount - id string a unique indentifier for the subaccount - name string an optional display name for the subaccount - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation - status string the current sending status of the subaccount, one of "active" or "paused" - reputation integer the subaccount's current reputation on a scale from 0 to 100 - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC) - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC) - sent_total integer the number of emails the subaccount has sent since it was created

`public struct`

# `pause( string $id )`

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.

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.

#### Parameters

$id
  `string`
  $id the unique identifier of the subaccount to pause

#### Returns

`struct`
the information for the paused subaccount - id string a unique indentifier for the subaccount - name string an optional display name for the subaccount - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation - status string the current sending status of the subaccount, one of "active" or "paused" - reputation integer the subaccount's current reputation on a scale from 0 to 100 - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC) - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC) - sent_total integer the number of emails the subaccount has sent since it was created

`public struct`

# `resume( string $id )`

Resume a paused subaccount's sending

Resume a paused subaccount's sending

#### Parameters

$id
  `string`
  $id the unique identifier of the subaccount to resume

#### Returns

`struct`
the information for the resumed subaccount - id string a unique indentifier for the subaccount - name string an optional display name for the subaccount - custom_quota integer an optional manual hourly quota for the subaccount. If not specified, the hourly quota will be managed based on reputation - status string the current sending status of the subaccount, one of "active" or "paused" - reputation integer the subaccount's current reputation on a scale from 0 to 100 - created_at string the date and time that the subaccount was created as a UTC string in YYYY-MM-DD HH:MM:SS format - first_sent_at string the date and time that the subaccount first sent as a UTC string in YYYY-MM-DD HH:MM:SS format - sent_weekly integer the number of emails the subaccount has sent so far this week (weeks start on midnight Monday, UTC) - sent_monthly integer the number of emails the subaccount has sent so far this month (months start on midnight of the 1st, UTC) - sent_total integer the number of emails the subaccount has sent since it was created