Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Ref] Simplify is_email_receipt in sendMail #18029

Merged
merged 1 commit into from
Aug 2, 2020

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Aug 1, 2020

Overview

Removes legacy handling from BAO_Contribution::sendMail

Before

The function attempts to calculate whether it actually should send mail

After

The function trusts it's caller.

Technical Details

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

Comments

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
@civibot
Copy link

civibot bot commented Aug 1, 2020

(Standard links)

@eileenmcnaughton
Copy link
Contributor Author

test this please

@mattwire mattwire merged commit 6c22094 into civicrm:master Aug 2, 2020
@eileenmcnaughton eileenmcnaughton deleted the sendmail branch August 2, 2020 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants