// and this function should assign them (assigning null if not set).
// the way the pcpParams & honor Params section works is a baby-step towards this.
$template = CRM_Core_Smarty::singleton();
- $template->assign('first_name', $this->_relatedObjects['contact']->first_name);
- $template->assign('last_name', $this->_relatedObjects['contact']->last_name);
- $template->assign('displayName', $this->_relatedObjects['contact']->display_name);
$template->assign('billingName', $values['billingName']);
- // For some unit tests contribution cannot contain paymentProcessor information
- $billingMode = empty($this->_relatedObjects['paymentProcessor']) ? CRM_Core_Payment::BILLING_MODE_NOTIFY : $this->_relatedObjects['paymentProcessor']['billing_mode'];
- $template->assign('contributeMode', CRM_Core_SelectValues::contributeMode()[$billingMode] ?? NULL);
-
//assign honor information to receipt message
$softRecord = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($this->id);
*
* @param string $rev
*/
- public function upgrade_5_43_alpha1($rev) {
+ public function upgrade_5_43_alpha1(string $rev): void {
$this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
$this->addTask('Fix DB Collation if needed on the relatonship cache table', 'fixRelationshipCacheTableCollation');
+
+ $this->addTask('Replace legacy displayName smarty token in Online contribution workflow template',
+ 'updateMessageToken', 'contribution_online_receipt', '$displayName', 'contact.display_name', $rev
+ );
+ $this->addTask('Replace legacy first_name smarty token in Online contribution workflow template',
+ 'updateMessageToken', 'contribution_online_receipt', '$first_name', 'contact.first_name', $rev
+ );
+ $this->addTask('Replace legacy last_name smarty token in Online contribution workflow template',
+ 'updateMessageToken', 'contribution_online_receipt', '$last_name', 'contact.last_name', $rev
+ );
}
public static function fixRelationshipCacheTableCollation():bool {
'contribution_invoice_receipt' => [
'$display_name' => 'contact.display_name',
],
+ 'contribution_online_receipt' => [
+ '$contributeMode' => 'no longer available / relevant',
+ '$first_name' => 'contact.first_name',
+ '$last_name' => 'contact.last_name',
+ '$displayName' => 'contact.display_name',
+ ],
],
];
}
'currency:::USD',
'receive_date:::' . date('Ymd', strtotime($contribution['receive_date'])),
"receipt_date:::\n",
- 'contributeMode:::notify',
'title:::Contribution',
- 'displayName:::Mr. Anthony Anderson II',
'contributionStatus:::Completed',
]);
$mut->stop();
'currency:::EUR',
'receive_date:::' . date('Ymd', strtotime($contribution['receive_date'])),
"receipt_date:::\n",
- 'contributeMode:::notify',
'title:::Contribution',
- 'displayName:::Mr. Anthony Anderson II',
'contributionStatus:::Completed',
]);
$mut->stop();
'is_pay_later:::1',
'email:::anthony_anderson@civicrm.org',
'pay_later_receipt:::This is a pay later receipt',
- 'displayName:::Mr. Anthony Anderson II',
'contributionPageId:::' . $contributionPageID,
'title:::Test Contribution Page',
'amount:::100',
'currency:::USD',
'receive_date:::' . date('Ymd', strtotime($receive_date)),
'receipt_date:::' . date('Ymd'),
- 'contributeMode:::notify',
'title:::Contribution',
- 'displayName:::Mr. Anthony Anderson II',
'trxn_id:::kazam',
'contactID:::' . $this->_params['contact_id'],
'contributionID:::' . $contribution['id'],
receipt_text:::{$receipt_text}
{/if}
is_pay_later:::{$is_pay_later}
- displayName:::{$displayName}
financialTypeId:::{$financialTypeId}
financialTypeName:::{$financialTypeName}
contactID:::{$contactID}
{if isset($is_recur)}
is_recur:::{$is_recur}
{/if}
- {if isset($contributeMode)}
- contributeMode:::{$contributeMode}
- {/if}
{if isset($trxn_id)}
trxn_id:::{$trxn_id}
{/if}