Opened 12 years ago
Closed 9 years ago
#4689 closed defect (bug) (fixed)
bp_core_email_from_name_filter() is too aggressive
Reported by: | r-a-y | Owned by: | |
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | 1.2.2 |
Component: | Core | Keywords: | needs-patch |
Cc: |
Description
bp_core_email_from_name_filter() hooks onto 'wp_mail_from_name'.
This is a little too aggressive because other plugins that send emails like Gravity Forms will use a different 'From' name, but that won't be seen because of BP.
I'd like to propose that we ditch this function and add the fourth parameter to each wp_mail() call in the BP codebase so we can modify the email headers (like the 'From' name) there.
Change History (9)
#2
@
12 years ago
I think the filter exists because of some old version of WPMU. I am unsure if there's a reason to keep it nowadays. Suggest we just deprecate it, and be done.
See also #3270
#3
@
12 years ago
I knew there was another ticket for this, but couldn't find it! Thanks for finding it, Paul.
I just looked into this briefly and it looks like we can't deprecate the function.
If we don't set the 'From' name, it will default to "WordPress":
https://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/pluggable.php#L317
I think Boone's approach of creating a wrapper bp_mail()
function is more flexible since we would only have to add the mail headers in one place instead of for each wp_mail()
call like I originally suggested.
If we're all in favor (favour for Paul!), I'll create a patch.
#4
@
12 years ago
Is there a compelling reason to change the from name? Beyond the fact that we already do.
#5
@
12 years ago
- Milestone changed from 1.7 to 1.8
Unhooking this is easy enough to do for those that need to do it. Agree a bp_mail() function makes huge amounts of sense, but too late in 1.7.
Punting to 1.8.
Big +1.
Instead of adding a
headers
param to eachwp_mail()
call, it might be more efficient (and easier to maintain and extend) to have a wrapperbp_mail()
function. This might also be helpful if we decide to overhaul email notifications in the future.