CRM_Mailing_BAO_Mailing
class CRM_Mailing_BAO_Mailing extends CRM_Mailing_DAO_Mailing
Class CRM_Mailing_BAO_Mailing
Constants
NOT_NULL |
|
IS_NULL |
|
DB_DAO_NOTNULL |
|
VALUE_SEPARATOR |
|
BULK_INSERT_COUNT |
|
BULK_INSERT_HIGH_COUNT |
|
QUERY_FORMAT_WILDCARD |
|
QUERY_FORMAT_NO_QUOTES |
|
Properties
static null | $_nullObject | from CRM_Core_DAO | |
static array | $_nullArray | from CRM_Core_DAO | |
static | $_dbColumnValueCache | from CRM_Core_DAO | |
static array | $_testEntitiesToSkip | Define entities that shouldn't be created or deleted when creating/ deleting test objects - this prevents world regions, countries etc from being added / deleted | from CRM_Core_DAO |
static object | $_factory | The factory class for this application. | from CRM_Core_DAO |
static | $_checkedSqlFunctionsExist | from CRM_Core_DAO | |
protected | $_options | https://issues.civicrm.org/jira/browse/CRM-17748 internal variable for DAO to hold per-query settings | from CRM_Core_DAO |
static string | $_tableName | Static instance to hold the table name. | from CRM_Mailing_DAO_Mailing |
static boolean | $_log | Should CiviCRM log any modifications to this table in the civicrm_log table. | from CRM_Mailing_DAO_Mailing |
int | $id | from CRM_Mailing_DAO_Mailing | |
int | $domain_id | Which site is this mailing for | from CRM_Mailing_DAO_Mailing |
int | $header_id | FK to the header component. | from CRM_Mailing_DAO_Mailing |
int | $footer_id | FK to the footer component. | from CRM_Mailing_DAO_Mailing |
int | $reply_id | FK to the auto-responder component. | from CRM_Mailing_DAO_Mailing |
int | $unsubscribe_id | FK to the unsubscribe component. | from CRM_Mailing_DAO_Mailing |
int | $resubscribe_id | from CRM_Mailing_DAO_Mailing | |
int | $optout_id | FK to the opt-out component. | from CRM_Mailing_DAO_Mailing |
string | $name | Mailing Name. | from CRM_Mailing_DAO_Mailing |
string | $mailing_type | differentiate between standalone mailings, A/B tests, and A/B final-winner | from CRM_Mailing_DAO_Mailing |
string | $from_name | From Header of mailing | from CRM_Mailing_DAO_Mailing |
string | $from_email | From Email of mailing | from CRM_Mailing_DAO_Mailing |
string | $replyto_email | Reply-To Email of mailing | from CRM_Mailing_DAO_Mailing |
string | $template_type | The language/processing system used for email templates. | from CRM_Mailing_DAO_Mailing |
longtext | $template_options | Advanced options used by the email templating system. (JSON encoded) | from CRM_Mailing_DAO_Mailing |
string | $subject | Subject of mailing | from CRM_Mailing_DAO_Mailing |
longtext | $body_text | Body of the mailing in text format. | from CRM_Mailing_DAO_Mailing |
longtext | $body_html | Body of the mailing in html format. | from CRM_Mailing_DAO_Mailing |
boolean | $url_tracking | Should we track URL click-throughs for this mailing? | from CRM_Mailing_DAO_Mailing |
boolean | $forward_replies | Should we forward replies back to the author? | from CRM_Mailing_DAO_Mailing |
boolean | $auto_responder | Should we enable the auto-responder? | from CRM_Mailing_DAO_Mailing |
boolean | $open_tracking | Should we track when recipients open/read this mailing? | from CRM_Mailing_DAO_Mailing |
boolean | $is_completed | Has at least one job associated with this mailing finished? | from CRM_Mailing_DAO_Mailing |
int | $msg_template_id | FK to the message template. | from CRM_Mailing_DAO_Mailing |
boolean | $override_verp | Should we overrite VERP address in Reply-To | from CRM_Mailing_DAO_Mailing |
int | $created_id | FK to Contact ID who first created this mailing | from CRM_Mailing_DAO_Mailing |
timestamp | $created_date | Date and time this mailing was created. | from CRM_Mailing_DAO_Mailing |
int | $scheduled_id | FK to Contact ID who scheduled this mailing | from CRM_Mailing_DAO_Mailing |
timestamp | $scheduled_date | Date and time this mailing was scheduled. | from CRM_Mailing_DAO_Mailing |
int | $approver_id | FK to Contact ID who approved this mailing | from CRM_Mailing_DAO_Mailing |
timestamp | $approval_date | Date and time this mailing was approved. | from CRM_Mailing_DAO_Mailing |
int | $approval_status_id | The status of this mailing. Values: none, approved, rejected | from CRM_Mailing_DAO_Mailing |
longtext | $approval_note | Note behind the decision. | from CRM_Mailing_DAO_Mailing |
boolean | $is_archived | Is this mailing archived? | from CRM_Mailing_DAO_Mailing |
string | $visibility | In what context(s) is the mailing contents visible (online viewing) | from CRM_Mailing_DAO_Mailing |
int | $campaign_id | The campaign for which this mailing has been initiated. | from CRM_Mailing_DAO_Mailing |
boolean | $dedupe_email | Remove duplicate emails? | from CRM_Mailing_DAO_Mailing |
int | $sms_provider_id | from CRM_Mailing_DAO_Mailing | |
string | $hash | Key for validating requests related to this mailing. | from CRM_Mailing_DAO_Mailing |
int | $location_type_id | With email_selection_method, determines which email address to use | from CRM_Mailing_DAO_Mailing |
string | $email_selection_method | With location_type_id, determine how to choose the email address to use. | from CRM_Mailing_DAO_Mailing |
string | $language | Language of the content of the mailing. Useful for tokens. | from CRM_Mailing_DAO_Mailing |
Methods
Class constructor.
Generate and assign an arbitrary value to a field of a test object.
Execute a query by the current DAO, localizing it along the way (if needed).
Static function to set the factory instance for this class.
Factory method to instantiate a new object from a table name.
Initialization for all DAO objects. Since we access DB_DO programatically we need to set the links manually.
Returns foreign keys and entity references.
Deletes items from table which match current objects variables.
Given an associative array of name/value pairs, extract all the values that belong to this object and initialize the object with said values
Store all the values from this object in an associative array this is a destructive store, calling function is responsible for keeping sanity of id's.
Create an attribute for this specific field. We only do this for strings and text
Get the size and maxLength attributes for this text field.
Check if there is a record with the same name in the db.
Check if there is a given column in a specific table.
Scans all the tables using a slow query and table name.
Checks if a constraint exists for a specified table.
Checks if CONSTRAINT keyword exists for a specified table.
Checks if the FK constraint name is in the format 'FK_tableName_columnName' for a specified column of a table.
Check whether a specific column in a specific table has always the same value.
Check whether a specific column in a specific table is always NULL.
Check if there is a given table in the database.
Get all the result records as mapping between columns.
Given a DAO name, a column name and a column value, find the record and GET the value of another column in that record
Given a DAO name, a column name and a column value, find the record and SET the value of another column in that record
Get sort string.
Fetch object based on array of properties.
Delete the object records that are associated with this contact.
Execute an unbuffered query.
Execute a query.
Execute a query and get the single result.
Compose the query by merging the parameters into it.
make a shallow copy of an object.
Cascade update through related entities.
Given the component id, compute the contact id since its used for things like send email
Fetch object based on array of properties.
Escape a list of strings for use with "WHERE X IN (.
Creates a test object, including any required objects it needs via recursion createOnly: only create in database, do not store or return the objects (useful for perf testing) ONLY USE FOR TESTING
Deletes the this object plus any dependent objects that are associated with it.
Set defaults when creating new entity.
No description
No description
Build a list of triggers via hook and add them to (err, reconcile them with) the database.
Because sql functions are sometimes lost, esp during db migration, we check here to avoid numerous support requests
Given a list of fields, create a list of references.
List all tables which have hard foreign keys to this table.
Lookup the value of a MySQL global configuration variable.
Update the fields array to also hold keys for pseudoconstant fields that relate to contained fields.
Get options for the called BAO object's field.
Provides documentation and validation for the buildOptions $context param
Get SQL where clause for SQL filter syntax input parameters.
SQL has a limit of 64 characters on various names: table name, trigger name, column name .
https://issues.civicrm.org/jira/browse/CRM-17748 Sets the internal options to be used on a query
https://issues.civicrm.org/jira/browse/CRM-17748 wrapper to pass internal DAO options down to DB_mysql/DB_Common level
Generates acl clauses suitable for adding to WHERE or ON when doing an api.get for this entity
This returns the final permissioned query string for this entity
ensure database name is 'safe', i.e. only contains word characters (includes underscores) and dashes, and contains at least one [a-z] case insenstive.
Return a mapping from field-name to the corresponding key (as used in fields()).
Returns the list of fields that can be imported
Returns the list of fields that can be exported
note that $job_id is used only as a variable in the temp table construction and does not play a role in the queries generated.
Returns an array that denotes the type of token that we are dealing with we use the type later on when we are doing a token replacement lookup
Retrieve a ref to an array that holds the email and text templates for this email assembles the complete template including the header and footer that the user has uploaded or declared (if they have done that)
Retrieve a ref to an array that holds all of the tokens in the email body where the keys are the type of token and the values are ordinal arrays that hold the token names (even repeated tokens) in the order in which they appear in the body of the email.
Returns the token set for all 3 parts as one set. This allows it to be sent to the hook in one call and standardizes it across other token workflows
Generate an event queue for a test job.
Given and array of headers and a prefix, job ID, event queue ID, and hash, add a Message-ID header if needed.
Static wrapper for getting verp and urls.
Get verp, urls and headers
Compose a message.
Return a list of group names for this mailing. Does not work with prior-mailing targets.
Add the mailings.
Construct a new mailing object, along with job and mailing_group objects, from the form values of the create mailing wizard.
Replace the list of recipients on a given mailing.
Get hash value of the mailing.
Generate a report. Fetch event count information, mailing data, and job status.
Get the count of mailings.
No description
No description
Returns all the mailings that this user can access. This is dependent on all the groups that the user has access to.
Get the rows for a browse operation.
Show detail Mailing report.
Delete Mails and all its associated records.
Delete Jobss and all its associated records related to test Mailings
No description
Get the search based mailing Ids.
Get the content/components of mailing based on mailing Id
No description
No description
No description
No description
wrapper for ajax activity selector.
Retrieve contact mailing.
Retrieve contact mailing count.
Get a list of permissions required for CRUD'ing each field (when workflow is enabled).
White-list of possible values for the entity_table field.
Get the public view url.
Get a list of template types which can be used as civicrm_mailing.template_type
.
Get a list of template types.
Details
at line 92
CRM_Core_DAO
__construct()
Class constructor.
in CRM_Mailing_DAO_Mailing at line 933
static
getTableName()
Returns the names of this table
in CRM_Core_DAO at line 112
static
init(string $dsn)
Initialize the DAO object.
in CRM_Core_DAO at line 131
static DB_common
getConnection()
in CRM_Core_DAO at line 142
protected
assignTestFK(string $fieldName, $fieldDef, array $params)
in CRM_Core_DAO at line 191
protected
assignTestValue(string $fieldName, array $fieldDef, int $counter)
Generate and assign an arbitrary value to a field of a test object.
in CRM_Core_DAO at line 303
reset()
Reset the DAO object.
DAO is kinda crappy in that there is an unwritten rule of one query per DAO.
We attempt to get around this crappy restriction by resetting some of DAO's internal fields. Use this with caution
in CRM_Core_DAO at line 323
static string
getLocaleTableName(string $tableName)
in CRM_Core_DAO at line 345
object
query(string $query, bool $i18nRewrite = TRUE)
Execute a query by the current DAO, localizing it along the way (if needed).
in CRM_Core_DAO at line 374
static
setFactory(object $factory)
Static function to set the factory instance for this class.
in CRM_Core_DAO at line 383
factory(string $table = '')
Factory method to instantiate a new object from a table name.
in CRM_Core_DAO at line 395
initialize()
Initialization for all DAO objects. Since we access DB_DO programatically we need to set the links manually.
in CRM_Core_DAO at line 411
array
keys()
Defines the default key as 'id'.
in CRM_Core_DAO at line 426
array
sequenceKey()
Tells DB_DataObject which keys use autoincrement.
'id' is autoincrementing by default.
in CRM_Mailing_DAO_Mailing at line 315
static array
getReferenceColumns()
Returns foreign keys and entity references.
in CRM_Mailing_DAO_Mailing at line 340
static array
fields()
Returns all the column names of this table
in CRM_Core_DAO at line 462
array
table()
Get/set an associative array of table columns
in CRM_Core_DAO at line 485
CRM_Core_DAO
save(bool $hook = TRUE)
Save DAO object.
in CRM_Core_DAO at line 536
delete(bool $useWhere = FALSE)
Deletes items from table which match current objects variables.
Returns the true on success
for example
Designed to be extended
$object = new mytable(); $object->ID=123; echo $object->delete(); // builds a conditon
$object = new mytable(); $object->whereAdd('age > 12'); $object->limit(1); $object->orderBy('age DESC'); $object->delete(true); // dont use object vars, use the conditions, limit and order.
in CRM_Core_DAO at line 552
log(bool $created = FALSE)
in CRM_Core_DAO at line 587
bool
copyValues(array $params)
Given an associative array of name/value pairs, extract all the values that belong to this object and initialize the object with said values
in CRM_Core_DAO at line 628
static
storeValues(object $object, array $values)
Store all the values from this object in an associative array this is a destructive store, calling function is responsible for keeping sanity of id's.
in CRM_Core_DAO at line 650
static array|null
makeAttribute(array $field)
Create an attribute for this specific field. We only do this for strings and text
in CRM_Core_DAO at line 703
static array
getAttribute(string $class, string $fieldName = NULL)
Get the size and maxLength attributes for this text field.
(or for all text fields) in the DAO object.
in CRM_Core_DAO at line 731
static
transaction($type)
in CRM_Core_DAO at line 754
static bool
objectExists(string $value, string $daoName, string $daoID, string $fieldName = 'name', string $domainID = NULL)
Check if there is a record with the same name in the db.
in CRM_Core_DAO at line 780
static bool
checkFieldExists(string $tableName, string $columnName, bool $i18nRewrite = TRUE)
Check if there is a given column in a specific table.
in CRM_Core_DAO at line 798
static array
getTableNames()
Scans all the tables using a slow query and table name.
in CRM_Core_DAO at line 820
static bool
isDBMyISAM(int $maxTablesToCheck = 10)
in CRM_Core_DAO at line 837
static string
getDatabaseName()
Get the name of the CiviCRM database.
in CRM_Core_DAO at line 851
static bool
checkConstraintExists(string $tableName, string $constraint)
Checks if a constraint exists for a specified table.
in CRM_Core_DAO at line 879
static bool
schemaRequiresRebuilding(array $tables = array("civicrm_contact"))
Checks if CONSTRAINT keyword exists for a specified table.
in CRM_Core_DAO at line 915
static bool
checkFKConstraintInFormat(string $tableName, string $columnName)
Checks if the FK constraint name is in the format 'FK_tableName_columnName' for a specified column of a table.
in CRM_Core_DAO at line 944
static bool
checkFieldHasAlwaysValue(string $tableName, string $columnName, string $columnValue)
Check whether a specific column in a specific table has always the same value.
in CRM_Core_DAO at line 961
static bool
checkFieldIsAlwaysNull(string $tableName, string $columnName)
Check whether a specific column in a specific table is always NULL.
in CRM_Core_DAO at line 977
static bool
checkTableExists(string $tableName)
Check if there is a given table in the database.
in CRM_Core_DAO at line 995
bool
checkVersion($version)
in CRM_Core_DAO at line 1013
static object
findById(int $id)
Find a DAO object for the given ID and return it.
in CRM_Core_DAO at line 1027
array
fetchAll()
Returns all results as array-encoded records.
in CRM_Core_DAO at line 1045
array
fetchMap(string $keyColumn, string $valueColumn)
Get all the result records as mapping between columns.
in CRM_Core_DAO at line 1070
static string|null
getFieldValue(string $daoName, int $searchValue, string $returnColumn = 'name', string $searchColumn = 'id', bool $force = FALSE)
Given a DAO name, a column name and a column value, find the record and GET the value of another column in that record
in CRM_Core_DAO at line 1120
static bool
setFieldValue(string $daoName, int $searchValue, string $setColumn, string $setValue, string $searchColumn = 'id')
Given a DAO name, a column name and a column value, find the record and SET the value of another column in that record
in CRM_Core_DAO at line 1146
static string
getSortString(array|object $sort, string $default = NULL)
Get sort string.
in CRM_Core_DAO at line 1177
static object
commonRetrieve(string $daoName, array $params, array $defaults, array $returnProperities = NULL)
Fetch object based on array of properties.
in CRM_Core_DAO at line 1202
static
deleteEntityContact(string $daoName, int $contactId)
Delete the object records that are associated with this contact.
in CRM_Core_DAO at line 1227
static CRM_Core_DAO
executeUnbufferedQuery(string $query, array $params = array(), bool $abort = TRUE, null $daoName = NULL, bool $freeDAO = FALSE, bool $i18nRewrite = TRUE, bool $trapException = FALSE)
Execute an unbuffered query.
This is a wrapper around new functionality exposed with CRM-17748.
in CRM_Core_DAO at line 1293
static CRM_Core_DAO|object
executeQuery(string $query, array $params = array(), bool $abort = TRUE, null $daoName = NULL, bool $freeDAO = FALSE, bool $i18nRewrite = TRUE, bool $trapException = FALSE)
Execute a query.
in CRM_Core_DAO at line 1343
static string|null
singleValueQuery(string $query, array $params = array(), bool $abort = TRUE, bool $i18nRewrite = TRUE)
Execute a query and get the single result.
in CRM_Core_DAO at line 1381
static string
composeQuery(string $query, array $params, bool $abort = TRUE)
Compose the query by merging the parameters into it.
in CRM_Core_DAO at line 1428
static
freeResult(null $ids = NULL)
in CRM_Core_DAO at line 1474
static CRM_Core_DAO
copyGeneric(string $daoName, array $criteria, array $newData = NULL, string $fieldsFix = NULL, string $blockCopyOfDependencies = NULL)
make a shallow copy of an object.
and all the fields in the object
in CRM_Core_DAO at line 1557
static CRM_Core_DAO|null
cascadeUpdate(string $daoName, $fromId, $toId, array $newData = array())
Cascade update through related entities.
in CRM_Core_DAO at line 1601
static array
getContactIDsFromComponent($componentIDs, string $tableName)
Given the component id, compute the contact id since its used for things like send email
in CRM_Core_DAO at line 1636
static object
commonRetrieveAll(string $daoName, string $fieldIdName = 'id', int $fieldId, $details, array $returnProperities = NULL)
Fetch object based on array of properties.
in CRM_Core_DAO at line 1658
static
dropAllTables()
in CRM_Core_DAO at line 1680
static string
escapeString($string)
in CRM_Core_DAO at line 1709
static string
escapeStrings(array $strings, string $default = NULL)
Escape a list of strings for use with "WHERE X IN (.
..)" queries.
in CRM_Core_DAO at line 1728
static string
escapeWildCardString($string)
in CRM_Core_DAO at line 1756
static object|array|NULL
createTestObject(string $daoName, array $params = array(), int $numObjects = 1, bool $createOnly = FALSE)
Creates a test object, including any required objects it needs via recursion createOnly: only create in database, do not store or return the objects (useful for perf testing) ONLY USE FOR TESTING
in CRM_Core_DAO at line 1839
static
deleteTestObjects(string $daoName, array $params = array())
Deletes the this object plus any dependent objects that are associated with it.
ONLY USE FOR TESTING
in CRM_Core_DAO at line 1885
static
setCreateDefaults(array $params, $defaults)
Set defaults when creating new entity.
(don't call this set defaults as already in use with different signature in some places)
in CRM_Core_DAO at line 1903
static string
createTempTableName(string $prefix = 'civicrm', bool $addRandomString = TRUE, null $string = NULL)
in CRM_Core_DAO at line 1923
static bool
checkTriggerViewPermission(bool $view = TRUE, bool $trigger = TRUE)
in CRM_Core_DAO at line 1971
static
debugPrint(null $message = NULL, bool $printDAO = TRUE)
in CRM_Core_DAO at line 1995
static
triggerRebuild(string $tableName = NULL, bool $force = FALSE)
deprecated
deprecated
Build a list of triggers via hook and add them to (err, reconcile them with) the database.
in CRM_Core_DAO at line 2006
static
checkSqlFunctionsExist()
Because sql functions are sometimes lost, esp during db migration, we check here to avoid numerous support requests
in CRM_Core_DAO at line 2023
static
dropTriggers(string $tableName = NULL)
deprecated
deprecated
Wrapper function to drop triggers.
in CRM_Core_DAO at line 2034
static
createTriggers(array $info, string $onlyTableName = NULL)
deprecated
deprecated
in CRM_Core_DAO at line 2045
static array
createReferenceColumns(string $className)
Given a list of fields, create a list of references.
in CRM_Core_DAO at line 2068
array
findReferences()
Find all records which refer to this entity.
in CRM_Core_DAO at line 2097
array
getReferenceCounts()
in CRM_Core_DAO at line 2134
static array
getReferencesToTable(string $tableName)
List all tables which have hard foreign keys to this table.
For now, this returns a description of every entity_id/entity_table reference. TODO: filter dynamic entity references on the $tableName, based on schema metadata in dynamicForeignKey which enumerates a restricted set of possible entity_table's.
in CRM_Core_DAO at line 2158
static mixed
getGlobalSetting(string $name, mixed $default = NULL)
Lookup the value of a MySQL global configuration variable.
in CRM_Core_DAO at line 2183
static protected
appendPseudoConstantsToFields(array $fields)
Update the fields array to also hold keys for pseudoconstant fields that relate to contained fields.
This is relevant where we want to offer both the ID field and the label field as an option, e.g. search builder.
It is currently limited for optionGroupName for purposes keeping the scope of the change small, but is appropriate for other sorts of pseudoconstants.
in CRM_Core_DAO at line 2209
static array|bool
buildOptions(string $fieldName, string $context = NULL, array $props = array())
Get options for the called BAO object's field.
This function can be overridden by each BAO to add more logic related to context. The overriding function will generally call the lower-level CRM_Core_PseudoConstant::get
in CRM_Core_DAO at line 2220
getOptionLabels()
Populate option labels for this object's fields.
in CRM_Core_DAO at line 2246
static array
buildOptionsContext(string $context = NULL)
Provides documentation and validation for the buildOptions $context param
in CRM_Core_DAO at line 2266
bool|array
getFieldSpec(string $fieldName)
in CRM_Core_DAO at line 2309
static NULL|string|array
createSQLFilter(string $fieldName, array $filter, string $type = NULL, string $alias = NULL, bool $returnSanitisedArray = FALSE)
Get SQL where clause for SQL filter syntax input parameters.
SQL version of api function to assign filters to the DAO based on the syntax $field => array('IN' => array(4,6,9)) OR $field => array('LIKE' => array('%me%)) etc
in CRM_Core_DAO at line 2372
static array
acceptedSQLOperators()
in CRM_Core_DAO at line 2409
static string
shortenSQLName(string $string, int $length = 60, bool $makeRandom = FALSE)
SQL has a limit of 64 characters on various names: table name, trigger name, column name .
..
For custom groups and fields we generated names from user entered input which can be longer than this length, this function helps with creating strings that meet various criteria.
in CRM_Core_DAO at line 2435
setOptions(array $options)
https://issues.civicrm.org/jira/browse/CRM-17748 Sets the internal options to be used on a query
in CRM_Core_DAO at line 2448
protected
_setDBOptions(array $options)
https://issues.civicrm.org/jira/browse/CRM-17748 wrapper to pass internal DAO options down to DB_mysql/DB_Common level
in CRM_Core_DAO at line 2463
setApiFilter(array $params)
deprecated
deprecated
in CRM_Core_DAO at line 2480
array
addSelectWhereClause()
Generates acl clauses suitable for adding to WHERE or ON when doing an api.get for this entity
Return format is in the form of fieldname => clauses starting with an operator. e.g.:
in CRM_Core_DAO at line 2521
static array
getSelectWhereClause(string $tableAlias = NULL)
This returns the final permissioned query string for this entity
With acls from related entities + additional clauses from hook_civicrm_selectWhereClause
in CRM_Core_DAO at line 2544
static bool
requireSafeDBName($database)
ensure database name is 'safe', i.e. only contains word characters (includes underscores) and dashes, and contains at least one [a-z] case insenstive.
in CRM_Mailing_DAO_Mailing at line 922
static array
fieldKeys()
Return a mapping from field-name to the corresponding key (as used in fields()).
in CRM_Mailing_DAO_Mailing at line 941
boolean
getLog()
Returns if this table needs to be logged
in CRM_Mailing_DAO_Mailing at line 951
static array
import(bool $prefix = false)
Returns the list of fields that can be imported
in CRM_Mailing_DAO_Mailing at line 962
static array
export(bool $prefix = false)
Returns the list of fields that can be exported
in CRM_Mailing_DAO_Mailing at line 969
static
indices($localize = TRUE)
Returns the list of indices
at line 104
static int
getRecipientsCount(int $job_id, int $mailing_id = NULL)
deprecated
deprecated
at line 123
static CRM_Mailing_Event_BAO_Queue|string
getRecipients(int $job_id, int $mailing_id = NULL, bool $storeRecipients = FALSE, bool $dedupeEmail = FALSE, null $mode = NULL)
note that $job_id is used only as a variable in the temp table construction and does not play a role in the queries generated.
at line 660
array
getDataFunc(string $token)
Returns an array that denotes the type of token that we are dealing with we use the type later on when we are doing a token replacement lookup
at line 766
array
getTemplates()
Retrieve a ref to an array that holds the email and text templates for this email assembles the complete template including the header and footer that the user has uploaded or declared (if they have done that)
at line 846
array
getTokens()
Retrieve a ref to an array that holds all of the tokens in the email body where the keys are the type of token and the values are ordinal arrays that hold the token names (even repeated tokens) in the order in which they appear in the body of the email.
note: the real work is done in the _getTokens() function
this function needs to have some sort of a body assigned either text or html for this to have any meaningful impact
at line 879
array
getFlattenedTokens()
Returns the token set for all 3 parts as one set. This allows it to be sent to the hook in one call and standardizes it across other token workflows
at line 928
void
getTestRecipients(array $testParams)
Generate an event queue for a test job.
at line 1012
static void
addMessageIdHeader(array $headers, string $prefix, string $job_id, string $event_queue_id, string $hash)
Given and array of headers and a prefix, job ID, event queue ID, and hash, add a Message-ID header if needed.
i.e. if the global includeMessageId is set and there isn't already a Message-ID in the array. The message ID is structured the same way as a verp. However no interpretation is placed on the values received, so they do not need to follow the verp convention.
at line 1053
static array
getVerpAndUrls(int $job_id, int $event_queue_id, string $hash, string $email)
Static wrapper for getting verp and urls.
at line 1082
array
getVerpAndUrlsAndHeaders(int $job_id, int $event_queue_id, string $hash, string $email, bool $isForward = FALSE)
Get verp, urls and headers
at line 1194
Mail_mime
compose(int $job_id, int $event_queue_id, string $hash, string $contactId, string $email, string $recipient, bool $test, $contactDetails, $attachments, bool $isForward = FALSE, string $fromEmail = NULL, null $replyToEmail = NULL)
Compose a message.
at line 1439
static
tokenReplace(CRM_Mailing_BAO_Mailing $mailing)
Replace tokens.
Get mailing object and replaces subscribeInvite, domain and mailing tokens.
at line 1547
array
getGroupNames()
Return a list of group names for this mailing. Does not work with prior-mailing targets.
at line 1581
static CRM_Mailing_DAO_Mailing
add(array $params, array $ids = array())
Add the mailings.
at line 1646
static object
create(array $params, array $ids = array())
Construct a new mailing object, along with job and mailing_group objects, from the form values of the create mailing wizard.
This function is a bit evil. It not only merges $params and saves the mailing -- it also schedules the mailing and chooses the recipients. Since it merges $params, it's also the only place to correctly trigger multi-field validation. It should be broken up.
In the mean time, use-cases which break under the weight of this evil may find reprieve in these extra evil params:
- skip_evil_bao_auto_recipients: bool
- skip_evil_bao_auto_schedule: bool
- evil_bao_validator: string|callable
at line 1807
static array
checkSendable(CRM_Mailing_DAO_Mailing $mailing)
at line 1853
static
replaceGroups(int $mailingId, string $type, string $entity, array $entityIds)
Replace the list of recipients on a given mailing.
at line 1873
static null|string
getMailingHash($id)
Get hash value of the mailing.
at line 1895
static array
report(int $id, bool $skipDetails = FALSE, bool $isSMS = FALSE)
Generate a report. Fetch event count information, mailing data, and job status.
at line 2384
int
getCount()
Get the count of mailings.
at line 2399
static
checkPermission(int $id)
at line 2419
static string
mailingACL(null $alias = NULL)
at line 2445
static bool|array
mailingACLIDs()
Returns all the mailings that this user can access. This is dependent on all the groups that the user has access to.
However since most civi installs dont use ACL's we special case the condition where the user has access to ALL groups, and hence ALL mailings and return a value of TRUE (to avoid the downstream where clause with a list of mailing list IDs
at line 2521
array
getRows(int $offset, int $rowCount, string $sort, null $additionalClause = NULL, array $additionalParams = NULL)
Get the rows for a browse operation.
at line 2611
static string
showEmailDetails(int $id)
Show detail Mailing report.
at line 2623
static void
del(int $id)
Delete Mails and all its associated records.
at line 2653
static void
delJob(int $id)
Delete Jobss and all its associated records related to test Mailings
at line 2666
array
getReturnProperties()
at line 2705
static void
commonCompose(CRM_Core_Form $form)
Build the compose mail form.
at line 2798
array
searchMailingIDs()
Get the search based mailing Ids.
at line 2831
static array
getMailingContent(array $report, $form, bool $isSMS = FALSE)
Get the content/components of mailing based on mailing Id
at line 2883
static mixed
overrideVerp(int $jobID)
at line 2905
static bool
processQueue(null $mode = NULL)
at line 2985
static mixed
getMailingsList(bool $isSMS = FALSE)
at line 3016
static null|string
hiddenMailingGroup(int $mid)
at line 3039
static array
getContactMailingSelector(array $params)
wrapper for ajax activity selector.
at line 3132
static array
getContactMailings(array $params)
Retrieve contact mailing.
at line 3151
static int
getContactMailingsCount(array $params)
Retrieve contact mailing count.
at line 3163
static array
getWorkflowFieldPerms()
Get a list of permissions required for CRUD'ing each field (when workflow is enabled).
at line 3196
static array
mailingGroupEntityTables()
White-list of possible values for the entity_table field.
at line 3211
static string
getPublicViewUrl(int $id, bool $absolute = TRUE)
Get the public view url.
at line 3227
static array
getTemplateTypes()
Get a list of template types which can be used as civicrm_mailing.template_type
.
at line 3261
static array
getTemplateTypeNames()
Get a list of template types.