$template->assign('last_name', $this->_relatedObjects['contact']->last_name);
$template->assign('displayName', $this->_relatedObjects['contact']->display_name);
if (!empty($values['lineItem']) && !empty($this->_relatedObjects['membership'])) {
- $template->assign('useForMember', TRUE);
+ $values['useForMember'] = TRUE;
}
//assign honor information to receipt message
$softRecord = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($this->id);
// We are trying to fight the good fight against leaky variables (CRM-17519) so let's get really explicit
// about ensuring the variables we want for the template are defined.
// @todo add to this until all tpl params are explicit in this function and not waltzing around the codebase.
- $valuesRequiredForTemplate = array('customPre', 'customPost', 'customPre_grouptitle', 'customPost_grouptitle');
+ $valuesRequiredForTemplate = array('customPre', 'customPost', 'customPre_grouptitle', 'customPost_grouptitle',
+ 'useForMember');
foreach ($valuesRequiredForTemplate as $valueRequiredForTemplate) {
if (!isset($values[$valueRequiredForTemplate])) {
$values[$valueRequiredForTemplate] = NULL;
$title = isset($values['title']) ? $values['title'] : CRM_Contribute_PseudoConstant::contributionPage($values['contribution_page_id']);
- // set email in the template here
+ // Set email variables explicitly to avoid leaky smarty variables.
+ // All of these will be assigned to the template, replacing any that might be assigned elsewhere.
$tplParams = array(
'email' => $email,
'receiptFromEmail' => CRM_Utils_Array::value('receipt_from_email', $values),
'customPre_grouptitle' => $values['customPre_grouptitle'],
'customPost' => $values['customPost'],
'customPost_grouptitle' => $values['customPost_grouptitle'],
+ 'useForMember' => $values['useForMember'],
);
if ($contributionTypeId = CRM_Utils_Array::value('financial_type_id', $values)) {