Remove noreply email from notification emails
-
Wordpress Version:4.9.2
bbPress Version: 2.5.14
Site: http://www.avaiya.comI have a couple of questions related to the default emails that get sent when people post to forums, follow topics, etc.
1. These emails show up as being sent from our admin email address, with the name Avaiya Media. I’d like to edit the name and the email address sending the emails. Do you know how I can do that?
2. These emails send a notification to the person who subscribed to that forum post, but they also
automatically send an email to noreply@avaiya.com. This is bouncing. How can I remove this email address when these emails are sent?Thanks!
-
Hi,
Have a look if this small plugin helps: https://www.tipsandtricks-hq.com/wordpress-plugin-change-wp-email-from-details-1883.
Pascal.
If you do not want to use a plugin, check out this snippets (that you could add into your functions.php):
add_filter( 'wp_mail_from_name', 'email_sent_from_name' ); function email_sent_from_name( $name ) { return 'SITE NAME'; } add_filter( 'wp_mail_from', 'email_sent_from' ); function email_sent_from( $email ) { return 'email@example.com'; }
Or for more granular tasks, consider even:
add_filter('bbp_get_do_not_reply_address','my_bbp_no_reply_email'); function no_reply_email(){ $email = 'noreply@yourdomain.com'; // any email you want return $email; } add_filter('bbp_subscription_to_email','my_bbp_subscription_to_email'); function my_bbp_subscription_to_email(){ $email = 'noreply@yourdomain.com'; // any email you want return $email; }
And where is these functions.php?
Best Regards Reto
Hi,
I have the same question as avaiya how to remove – not to change – the noreply-address from the list of notified recipients if someone writes a post as this notification is useless.
Thanks
Michaelbbpress sends the notification as a single email, with the noreply address as the to/from an the recipients are then bcc’d in.
So you can’t simply remove it.
you can amend how bbpress sends using this plugin
Thanks, now I understand the issue completely.
great – glad you are fixed
Looks like something may have changed as this code is now producing a fatal error.
I used the second snippet to edit the reply emails but while the email send has been successfully modified (and is no longer bouncing), the user now gets a white screen…
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘my_bbp_no_reply_email’ not found or invalid function name in /home/customer/www/[domain]/public_html/wp-includes/class-wp-hook.php on line 287
Has something been updated in the codex?
the code is valid – I suspect you have a copy/paste issue – sometimes a ‘ becomes corrupted,
Can you post exactly what you have in your file
Hi Robin. I see this topic is old, but I am receiving the same fatal error on one of our topics. Pasting error from log below.
Any thoughts?
This is from log when someone replies to a specific topic.
2024/01/25 00:28:44 [error] 104203#104203: *2522045 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function “my_bbp_no_reply_email” not found or invalid function name in /www/igotmyrefund/public/wp-includes/class-wp-hook.php:324
Stack trace:
#0 /www/igotmyrefund/public/wp-includes/plugin.php(205): WP_Hook->apply_filters(‘noreply@igotmyr…’, Array)
#1 /www/igotmyrefund/public/wp-content/plugins/bbpress/includes/common/functions.php(999): apply_filters(‘bbp_get_do_not_…’, ‘noreply@igotmyr…’)
#2 /www/igotmyrefund/public/wp-content/plugins/bbpress/includes/common/functions.php(1135): bbp_get_do_not_reply_address()
#3 /www/igotmyrefund/public/wp-includes/class-wp-hook.php(326): bbp_notify_topic_subscribers(4534524, 4534520, 4534009, Array, 102593)
#4 /www/igotmyrefund/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#5 /www/igotmyrefund/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#6 /www/igotmyref” while reading response header from upstream, client: 2600:387:15:1a0e::d, server: igotmyrefund.com, request: “POST /forums/topic/child-care-credit-ctc-changes/ HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php8.0-fpm-igotmyrefund.sock:”, host: “igotmyrefund.com:32769”, referrer: “https://igotmyrefund.com/forums/topic/child-care-credit-ctc-changes/”I’d suspect you are using php version 8.2 – but can you confirm?
Running 8.0. I have option to change to 8.1 or 8.2 through my host. I just noticed that they recommend using 8.1.
I did a redirect from that page to another for now. It was only happening on that topic as far as I know now unless a user reports another.
ok thanks, I’ll ignore unless you come back
Hi!
I’am very interested to remove noreply email from notification emails. How can I do it ?
I run bbpress Version : 2.6.9
All my best,
DavidGreat! Thank you so much
Hello again. I got a critical error on another topic when trying to reply.
Should updating PHP my first troubleshooting step?
do you have details of the error?
It just displays critical error.
xxx
i tried to take out site-specific stuff
I have this in a plugin that we use for a lot of our changes that we want separate from child theme functions.php I don’t know if related.
function no_reply_email(){ $email = 'no-reply@sitename.com'; // any email you want return $email; } add_filter('bbp_get_do_not_reply_address','my_bbp_no_reply_email'); function my_bbp_subscription_to_email(){ $email = 'no-reply@sitename.com'; // any email you want return $email; } add_filter('bbp_subscription_to_email','my_bbp_subscription_to_email');
Sorry for so many replies. It seems there is a time limit to edit my replies. But still would like to remove site specific paths asap
And this PHP error:
2024/02/08 04:46:43 [error] 88782#88782: *2901466 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function “my_bbp_no_reply_email” not found or invalid function name in /www/sitename/public/wp-includes/class-wp-hook.php:324
- You must be logged in to reply to this topic.