[Ref] Simplify is_email_receipt in sendMail
authoreileen <emcnaughton@wikimedia.org>
Sat, 1 Aug 2020 05:35:38 +0000 (17:35 +1200)
committereileen <emcnaughton@wikimedia.org>
Sat, 1 Aug 2020 05:41:20 +0000 (17:41 +1200)
commit081ee4443a2bd0fea13e3d0f7504dffe9ba5e424
treebecc55eef05445d99befa5798202536cd26f985c
parenteae974dd25fb9a50729ee41cf909bf8b03066141
[Ref] Simplify is_email_receipt in sendMail

This function has evolved through refactoring so there was a time when this code needed to decide whether to
send emails out or not. However, the function is now called more deliberately -ie
1) from completeTransaction - where it is only called if the decision to send an email is made
2) from the search action send Email receipts - where a user has made the decision to send (or pdf)
receipts and unless it's being called with returnMessageText = TRUE (to construct a pdf) then
send makes sense

Ergo we should send unless returnMessageText = TRUE
CRM/Contribute/BAO/Contribution.php
api/v3/Contribution.php