Methods summary
public
|
#
__construct( )
Initialize Email Groups
Overrides
|
public
mixed
|
#
add( array $vars )
Adds an email group
Parameters
- $vars
An array of variable email group info, including:
- action A unique action
- type The type of user this email group applies to (optional, default 'client')
- notice_type The type of notice this email is for ('bcc', 'to', or null for none; optional, default null)
- plugin_dir The directory where the plugin resides that is associated with this email group (optional)
- tags Tags that apply to this group (optional, default NULL)
Returns
mixed The email group ID, or void on error
|
public
|
#
edit( integer $id, array $vars )
Updates an email group
Parameters
- $id
- The ID of the email group to edit
- $vars
An array of variable email group info, including:
- action A unique action
- type The type of user this email group applies to (optional, default 'client')
- notice_type The type of notice this email is for ('bcc', 'to', or null for none; optional)
- plugin_dir The directory where the plugin resides that is associated with this email group (optional)
- tags Tags that apply to this group (optional, default NULL)
|
public
|
#
delete( integer $id )
Deletes an email group
Parameters
|
public
mixed
|
#
getByAction( string $action )
Fetches an email group
Parameters
- $action
- The type of email group to fetch
Returns
mixed An stdClass object representing the email group, or false if one does not exist
|
public
array
|
#
getAll( string $type = 'client', boolean $core = true )
Fetches a list of all email groups irrespective of company
Fetches a list of all email groups irrespective of company
Parameters
- $type
The type of email groups to fetch, one of the following (optional, default "client")
- $core
- True to fetch all core email groups, or false to fetch all plugin-related email groups
Returns
array A list of stdClass objects representing email groups
|
public
array
|
#
getAllByNoticeType( mixed $notice_type, string $type = null, string $core = true )
Fetches a list of all email groups by the notice type
Fetches a list of all email groups by the notice type
Parameters
- $notice_type
A string representing the notice type to fetch, one of the following:
- bcc The BCC type
- to The To type
- null
- $type
The type of email groups to fetch, one of the following (optional)
- $core
True to fetch all core email groups, or false to
fetch all plugin-related email groups (optional, default true)
Returns
array A list of stdClass objects representing email groups
|
public
array
|
#
getAllEmails( integer $company_id, string $type = 'client', string $core = true, string $lang = null )
Fetches a list of all emails and email groups under a company for a specific type and language
Fetches a list of all emails and email groups under a company for a specific type and language
Parameters
- $company_id
- The company ID to fetch email groups for
- $type
- The type of email group to get, "client", "staff", "shared" (optional, default "client")
- $core
True to fetch all core email groups, or false to
fetch all plugin-related email groups (optional, default true)
- $lang
The language in ISO 636-1 2-char + "_"
+ ISO 3166-1 2-char (e.g. en_us) (optional, defaults to default language)
Returns
array A list of stdClass objects representing emails
|
public
boolean
|
#
validateType( string $type )
Validates an email group's 'type' field
Validates an email group's 'type' field
Parameters
Returns
boolean True if type is validated, false otherwise
|