Email receipt for subsequent recurring contributions not sending as expected
I saw stripe#456 (closed) but this isn't exactly the same just involves the similar concept of how to determine whether to send a receipt.
It looks like the code in MJWIPNTrait::getSendEmailReceipt is supposed to first check the recurring contribution, then the contribution page if there is one, otherwise default to 0. But I can't find anywhere, at least with stripe, where the contribution_recur_id gets set, so it never checks the recurring. And this matches my tests for both backend and contribution page contributions, i.e. backend NEVER sends a subsequent receipt, and via page only sends if the page has the receipt setting turned on.
I'm waiting for some more tests to come in but it looks like this helps:
--- a/CRM/Core/Payment/MJWIPNTrait.php
+++ b/CRM/Core/Payment/MJWIPNTrait.php
@@ -349,6 +356,8 @@ trait CRM_Core_Payment_MJWIPNTrait {
);
// Optional Params: fee_amount
+ $this->setContributionRecurID($repeatContributionParams['contribution_recur_id']);
+
// Creat contributionParams for Contribution.repeattransaction and set some values
$contributionParams = $repeatContributionParams;
// Status should be pending if we have a successful payment
Or maybe better would be for getSendEmailReceipt to look up and set the recur id if it has never been set.