/**
* Fetch object based on array of properties
*
- * @param array $params (reference ) an assoc array of name/value pairs
- * @param array $defaults (reference ) an assoc array to hold the flattened values
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
+ * @param array $defaults
+ * (reference ) an assoc array to hold the flattened values.
*
* @return CRM_Core_BAO_MessageTemplate object
* @static
/**
* Update the is_active flag in the db
*
- * @param int $id id of the database record
- * @param boolean $is_active value we want to set the is_active field
+ * @param int $id
+ * Id of the database record.
+ * @param bool $is_active
+ * Value we want to set the is_active field.
*
- * @return Object DAO object on sucess, null otherwise
+ * @return Object
+ * DAO object on sucess, NULL otherwise
* @static
*/
public static function setIsActive($id, $is_active) {
/**
* Add the Message Templates
*
- * @param array $params reference array contains the values submitted by the form
+ * @param array $params
+ * Reference array contains the values submitted by the form.
*
* @static
*
* @param int $messageTemplateID
* @param $from
*
- * @return bool|null
+ * @return bool|NULL
*/
public static function sendReminder($contactId, $email, $messageTemplateID, $from) {
}
list($details) = CRM_Utils_Token::getTokenDetails(array($contactId),
$returnProperties,
- null, null, false,
+ NULL, NULL, FALSE,
$tokens,
'CRM_Core_BAO_MessageTemplate');
- $contact = reset( $details );
+ $contact = reset($details);
// call token hook
$hookTokens = array();
$bodyType = "body_{$value}";
if ($$bodyType) {
CRM_Utils_Token::replaceGreetingTokens($$bodyType, NULL, $contact['contact_id']);
- $$bodyType = CRM_Utils_Token::replaceDomainTokens($$bodyType, $domain, true, $tokens, true);
- $$bodyType = CRM_Utils_Token::replaceContactTokens($$bodyType, $contact, false, $tokens, false, true);
- $$bodyType = CRM_Utils_Token::replaceComponentTokens($$bodyType, $contact, $tokens, true);
- $$bodyType = CRM_Utils_Token::replaceHookTokens($$bodyType, $contact , $categories, true);
+ $$bodyType = CRM_Utils_Token::replaceDomainTokens($$bodyType, $domain, TRUE, $tokens, TRUE);
+ $$bodyType = CRM_Utils_Token::replaceContactTokens($$bodyType, $contact, FALSE, $tokens, FALSE, TRUE);
+ $$bodyType = CRM_Utils_Token::replaceComponentTokens($$bodyType, $contact, $tokens, TRUE);
+ $$bodyType = CRM_Utils_Token::replaceHookTokens($$bodyType, $contact, $categories, TRUE);
}
}
$html = $body_html;
}
// do replacements in message subject
- $messageSubject = CRM_Utils_Token::replaceContactTokens($body_subject, $contact, false, $tokens);
- $messageSubject = CRM_Utils_Token::replaceDomainTokens($messageSubject, $domain, true, $tokens);
- $messageSubject = CRM_Utils_Token::replaceComponentTokens($messageSubject, $contact, $tokens, true);
- $messageSubject = CRM_Utils_Token::replaceHookTokens($messageSubject, $contact, $categories, true);
+ $messageSubject = CRM_Utils_Token::replaceContactTokens($body_subject, $contact, FALSE, $tokens);
+ $messageSubject = CRM_Utils_Token::replaceDomainTokens($messageSubject, $domain, TRUE, $tokens);
+ $messageSubject = CRM_Utils_Token::replaceComponentTokens($messageSubject, $contact, $tokens, TRUE);
+ $messageSubject = CRM_Utils_Token::replaceHookTokens($messageSubject, $contact, $categories, TRUE);
$messageSubject = $smarty->fetch("string:{$messageSubject}");
/**
* Revert a message template to its default subject+text+HTML state
*
- * @param integer id id of the template
+ * @param int id id of the template
*
* @return void
*/
/**
* Send an email from the specified template based on an array of params
*
- * @param array $params a string-keyed array of function params, see function body for details
+ * @param array $params
+ * A string-keyed array of function params, see function body for details.
*
- * @return array of four parameters: a boolean whether the email was sent, and the subject, text and HTML templates
+ * @return array
+ * of four parameters: a boolean whether the email was sent, and the subject, text and HTML templates
*/
public static function sendTemplate($params) {
$defaults = array(
if (empty($params['attachments'])) {
$params['attachments'] = array();
}
- $params['attachments'][] = CRM_Utils_Mail::appendPDF('Invoice.pdf', $pdfHtml, $format) ;
+ $params['attachments'][] = CRM_Utils_Mail::appendPDF('Invoice.pdf', $pdfHtml, $format);
}
$pdf_filename = '';
if ($config->doNotAttachPDFReceipt &&