Remove Reply-To from E-Mail headers
-
Hi,
I am using your plugin with pleasure and I like it very much 🙂 Thank you for that plugin!I have a problem with the filter
user_registration_modify_user_email_header. It is intended to be used to modify the E-Mail headers before sending an E-Mail. I want to remove the Reply-To header because my Webserver is thinking that the registration E-Mail coming to the admin is a spam due to that header.So in
functions.phpI put that code:add_action( 'plugins_loaded', function() {
// Plugin: User Registration & Membership: modify email header: remove ReplyTo
add_filter( 'user_registration_modify_user_email_header', 'my_user_registration_modify_user_email_header', 70, 3 );
} );function my_user_registration_modify_user_email_header( $headers, $sender_email, $sender_name ) {
$new_headers = [];
foreach ( $headers as $header ) {
if ( strpos( $header, 'Reply-To:' ) === FALSE ) {
$new_headers[] = $header;
continue;
}
}
return $new_headers;
}The problem is that this code is never executed. I made some error_log outputs in that function and I do not get some output in the debug.log. And when I register a new user on my website, then the E-Mails come to the admin still have the header “Reply-To”.
I also put some error_log in your original method
UR_Emailer::ur_get_header()(includes/class-ur-emailer.php) to check, if something happens there, but still I get no output in the debug.log.Is there another way the E-Mails are sent with? Can you maybe give me some hints how to accomplish that? Thank you in advance!
WasilijI use the following:
– PHP v8.1 (apache)
– WP v6.8.3
– Plugin v4.4.4The page I need help with: [log in to see the link]
The topic ‘Remove Reply-To from E-Mail headers’ is closed to new replies.