Overview

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • auth
        • ldap
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
      • exchange
        • rates
          • currency
            • layer
          • fixer
          • open
            • exchange
              • rates
          • x
            • rates
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • perforated
            • invoice
          • quickbooks
            • invoice
          • templates
            • default
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • reports
        • aging
          • invoices
        • client
          • data
            • portability
        • custom
          • report
        • invoice
          • creation
        • package
          • revenue
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • core
      • Automation
        • Tasks
          • Common
          • Task
        • Type
          • Common
          • Cron
      • Pricing
        • ItemComparator
        • MetaItem
        • Modifier
          • Type
            • Description
              • Type
                • Discount
                • Option
                • Service
                • Tax
            • Discount
            • Price
            • Proration
        • Presenter
          • Build
            • Invoice
            • InvoiceData
            • Options
            • Service
            • ServiceChange
            • ServiceData
          • Collection
          • Format
            • Fields
            • Type
              • Discount
              • Item
              • Option
              • Options
              • Package
              • Pricing
              • Service
              • Tax
          • Items
            • Invoice
            • Service
          • Type
      • ServiceProviders
      • Util
        • Captcha
          • Captchas
          • Common
        • Common
          • Traits
        • Events
          • Common
          • Handlers
          • Observers
        • Filters
          • Common
        • GeoIp
        • Input
          • Fields
            • Common
        • Tax
        • Widgets
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • helpers
      • color
      • data
        • structure
  • None
  • PHP

Classes

  • Accounts
  • Actions
  • ApiKeys
  • Backup
  • CalendarEvents
  • ClientGroups
  • Clients
  • Companies
  • Contacts
  • Countries
  • Coupons
  • CouponTerms
  • CronTasks
  • Currencies
  • EmailGroups
  • Emails
  • EmailVerifications
  • Encryption
  • GatewayManager
  • Invoices
  • InvoiceTemplateManager
  • Languages
  • Logs
  • Marketplace
  • MessageGroups
  • Messages
  • MessengerManager
  • ModuleClientMeta
  • ModuleManager
  • ModuleTypes
  • Navigation
  • PackageGroups
  • PackageOptionGroups
  • PackageOptions
  • Packages
  • Payments
  • Permissions
  • PluginManager
  • Pricings
  • ReportManager
  • ServiceChanges
  • ServiceInvoices
  • Services
  • Settings
  • Staff
  • StaffGroups
  • States
  • SystemEvents
  • Taxes
  • Themes
  • Transactions
  • Users
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class EmailGroups

Email Group management

Model
Extended by AppModel uses Blesta\Core\Util\Common\Traits\Container
Extended by EmailGroups
Package: blesta\app\models
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at app/models/email_groups.php
Methods summary
public
# __construct( )

Initialize Email Groups

Initialize Email Groups

Overrides

AppModel::__construct()
public mixed
# add( array $vars )

Adds an email group

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

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

Deletes an email group

Parameters

$id
The email group ID
public mixed
# getByAction( string $action )

Fetches an email group

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")

  • client
  • staff
  • shared
$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)

  • client
  • staff
  • shared
$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

$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 used from Blesta\Core\Util\Common\Traits\Container
getFromContainer()
Properties inherited from AppModel
$logger, $replacement_keys
Blesta API documentation generated by ApiGen