4 * @support template-only
5 * @method array getContact()
6 * @method $this setContact(array $contact)
7 * @method array getContributionRecur()
9 class CRM_Contribute_WorkflowMessage_RecurringEdit
extends Civi\WorkflowMessage\GenericWorkflowMessage
{
10 use CRM_Contribute_WorkflowMessage_RecurringTrait
;
12 public const WORKFLOW
= 'contribution_recurring_edit';
15 * The recurring contribution contact.
26 * Smarty template historically defined a property 'receipt_from_email'.
27 * (Note the asymmetric lack of 'receipt_from_name'.)
29 * TODO: This should probably be deprecated/converted/reconciled with `$this->from` in the basic AddressingTrait.
32 * @scope tplParams as receipt_from_email
34 public $receiptFromEmail;
36 protected function exportExtraTokenContext(array &$export): void
{
37 $export['smartyTokenAlias']['installments'] = 'contribution_recur.installments';
38 $export['smartyTokenAlias']['amount'] = 'contribution_recur.amount';
39 $export['smartyTokenAlias']['recur_frequency_unit'] = 'contribution_recur.frequency_unit:label';
40 $export['smartyTokenAlias']['recur_frequency_interval'] = 'contribution_recur.frequency_interval';
43 protected function exportExtraTplParams(array &$export): void
{
44 if (empty($export['receipt_from_email']) && !empty($this->from
)) {
45 // At a minimum, we can at least autofill 'receipt_from_email' in the case where it's missing.
46 $export['receipt_from_email'] = $this->getFrom('record')['email'];