Extract code to set isEmailReceipt in Contribution.completeOrder
authoreileen <emcnaughton@wikimedia.org>
Sun, 2 Aug 2020 11:03:01 +0000 (23:03 +1200)
committereileen <emcnaughton@wikimedia.org>
Mon, 3 Aug 2020 23:58:20 +0000 (11:58 +1200)
commit68dce20c5fae668a251ab80172f39f50b3babaac
tree28970e4529c88e33673f36d5ae657620abd999bb
parent0fc6c3b216aba04ff4f28927dd0025f31d2fab3e
Extract code to set isEmailReceipt in Contribution.completeOrder

This consolidates all the code in the completeOrder that determines whether or not to send an email receipt.

Note that
- testCompleteTransactionWithEmailReceiptInput tests that input is respected
- for events the event::sendMail function will not send unless it's configured for the event - which
explains our final default of TRUE (testCompleteTransactionWithParticipantRecord)
- testCompleteTransaction covers the back-office case which also defaults to true
- I figure the cost of reloading the value for contribution_recur is pretty cheap compared to the confusion of passing values around
- testpayLater covers contribution_page with is_email_receipt
CRM/Contribute/BAO/Contribution.php