Class EmailGroups
-
Model
-
AppModel
-
EmailGroups
Methods summary
public
|
#
__construct( )
Initialize Email Groups
Overrides
|
public
mixed
|
#
add( array $vars )
Adds an email group
Parameters
- $vars
array $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( array $id, array $vars )
Updates an email group
Parameters
- $id
array $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)
- $vars
|
public
|
#
delete( integer $id )
Deletes an email group
Parameters
- $id
integer $id The email group ID
|
public
mixed
|
#
getByAction( string $action )
Fetches an email group
Parameters
- $action
string $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
string $type The type of email groups to fetch, one of the following (optional, default
"client") - client - staff - shared
- $core
boolean $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
mixed $notice_type A string representing the notice type to fetch, one of the
following: - bcc The BCC type - to The To type - null
- $type
string $type The type of email groups to fetch, one of the following (optional) -
client - staff - shared
- $core
string $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
integer $company_id The company ID to fetch email groups for
- $type
string $type The type of email group to get, "client", "staff", "shared" (optional,
default "client")
- $core
string $core True to fetch all core email groups, or false to fetch all plugin-related
email groups (optional, default true)
- $lang
string $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
- $type
string $type The type
Returns
boolean True if type is validated, false otherwise
|
Methods inherited from AppModel
_()
,
boolToInt()
,
currencyToDecimal()
,
dateToUtc()
,
errors()
,
getPerPage()
,
ifSet()
,
loadCrypto()
,
setDefaultIfEmpty()
,
setPerPage()
,
setRulesIfSet()
,
strToBool()
,
systemDecrypt()
,
systemEncrypt()
,
systemHash()
,
truncateDecimal()
,
validateExists()
,
validateStateCountry()
Methods inherited from Model
affectedRows()
,
begin()
,
commit()
,
getConnection()
,
lastInsertId()
,
makeDSN()
,
prepare()
,
query()
,
rollBack()
,
setAttribute()
,
setFetchMode()
Magic methods summary
Properties summary
Properties inherited from AppModel
$replacement_keys