Page MenuHomePhabricator

WorkflowMessage ignores set ContributionRecurID, picks first recur from contact
Closed, InvalidPublic

Description

I think we are relying on a little more magic than actually exists - e.g in RecurUpgradeEmail/Render we have this snippet:

$rendered = WorkflowMessage::render(FALSE)
     ->setLanguage($email['contact_id.preferred_language'])
     ->setValues(['contributionRecurID' => $this->getContributionRecurID(), 'contactID' => $this->getContactID()])
     ->setWorkflow('recurring_upgrade_message')->execute();

and we expect any contribution_recur tokens to refer to the recur with the supplied contribution recur ID. But it seems that it's just picking the first contribution_recur on the record. @AMJohnson noticed an amount mismatch in her recurring upgrade thank you email. She had an older Braintree recur for $1.10 and a new $1 adyen recur that she upgraded to $1.50, so the Recur Upgrade TY email should have mentioned $1.50. Instead it mentioned $1.10.

Event Timeline

Still trying to replicate this on dev - I created two recurring donations with the older one a braintree one, then upgraded the second. The email correctly referred to the upgrade amount of the second donation, not the first.

Oho, our RecurUpgradeMessage is not the culprit here.

Looking at the RecurUpgrade email activities for @AMJohnson's CID, they all seem to be referring to the right amount. And the text she quoted in the notes doc isn't from the recurring_upgrade_message template, but from the email sent via Acoustic. That one will be targeted to ONLY donors with a single recur, so there should be no problem here.

XenoRyet set Final Story Points to 0.