-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
CRM-21574 Allow to disable sending of email from source contact for tell a friend on pcp #11425
CRM-21574 Allow to disable sending of email from source contact for tell a friend on pcp #11425
Conversation
760f57d
to
0df107f
Compare
@mlutfy Would you take a look at this when you get a moment? As I know you have an interest. |
Jenkins test this please |
0df107f
to
a6fca2c
Compare
@yashodha Would you have time to look at this? It's the last piece of the emails from source contact stuff. |
Hey @mattwire, spotted your msg about this on chat and got inspired to try a review. I'm getting an error when "Allow Mail to be sent from logged in contact's email address" is unticked. Undefined index: email_from in CRM_Friend_BAO_Friend::sendMail() (line 328 of CRM/Friend/BAO/Friend.php) My reading is this is not an issue with the patch - but that the previous behaviour was masking the issue. Before the patch the test for an empty value in $values['email_from'] was not wrapped in the conditional so this error didn't occur. I think if we add an else on line 195 that catches the case for a contribution page where the receipt email is not set that inserts a sensible from address value? The other issue I think we might need to think about with this is that while this changes what happens in the code - what is displayed to a user is no longer accurate - I think we should probably update the template at the same time so that the "from" shows where the email will actually come from. |
I assume grabbing the default that would apply for non events/contribution pages is a sensible option so would be something like:
|
a6fca2c
to
a235933
Compare
@stesi561 Thanks for the review. I've pushed an updated patch which should fix the issue you found (and it also adds some other cleanup on that class). If you get a chance would you mind reviewing once again? |
a235933
to
d73f038
Compare
d73f038
to
95e76d7
Compare
@mattwire clean up PR merged now - closing this - please re-open / open anew when rebased etc |
Overview
I've pulled out the NFC changes in this PR into #12355 which should be reviewed/merged first.
When sending emails for personal campaign pages and enabling the "Tell a Friend" functionality it tries to send email from the contact IDs email address. However this is not always desirable as it can break SPF/DMARC and lead to bounced/failed email delivery.
@bgm I think you might be interested in - as it's not something I actually use :-) But thought I'd take a quick look as I needed to for activity assignees