}
}
else {
+ $values['modelProps'] = $input['modelProps'] ?? [];
return CRM_Contribute_BAO_ContributionPage::sendMail($ids['contact'], $values, $isTest, $returnMessageText);
}
}
'tokenContext' => $tokenContext,
'isTest' => $isTest,
'PDFFilename' => 'receipt.pdf',
+ 'modelProps' => $values['modelProps'] ?? [],
];
if ($returnMessageText) {
'receipt_text',
'pay_later_receipt',
'payment_processor_id',
- 'model',
];
$input = array_intersect_key($params, array_flip($allowedParams));
- if (!isset($input['model'])) {
- $input['model'] = [
- // Pass through legacy receipt_text.
- 'userEnteredText' => $input['tplParams']['receipt_text'] ?? NULL,
- ];
- }
+ $input['modelProps'] = [
+ // Pass through legacy receipt_text.
+ 'userEnteredText' => $params['receipt_text'] ?? NULL,
+ ];
CRM_Contribute_BAO_Contribution::sendMail($input, [], $params['id']);
return [];
}
unset($params[$field]);
}
}
- if (!isset($params['model'])) {
- $params['model'] = [
- // Pass through legacy receipt_text.
- 'userEnteredText' => $params['tplParams']['receipt_text'] ?? NULL,
- ];
- }
+ $params['modelProps'] = [
+ 'userEnteredText' => $params['tplParams']['receipt_text'] ?? NULL,
+ ];
if (empty($params['messageTemplateID'])) {
if (empty($params['workflow'])) {
// Can't use civicrm_api3_verify_mandatory for this because it would give the wrong field names
<tr>
<td>
{assign var="greeting" value="{contact.email_greeting_display}"}{if $greeting}<p>{$greeting},</p>{/if}
- {if !empty($receipt_text)}
- <p>{$receipt_text|htmlize}</p>
- {/if}
+ {if $userText}
+ <p>{$userText}</p>
+ {elseif {contribution.contribution_page_id.receipt_text|boolean}}
+ <p>{contribution.contribution_page_id.receipt_text}</p>
+ {/if}
{if $is_pay_later}
<p>{$pay_later_receipt}</p> {* FIXME: this might be text rather than HTML *}