Hi @stardeuche,
Thanks for your message.
You can change the ‘From’ name and email address for most of the notifications in BNFW. The only ones you can’t do this on are ones where there isn’t a filter available for that particular email within WordPress. That being said, there is a blanket approach with a caveat, which you can read about here: https://betternotificationsforwp.com/documentation/compatibility/changing-name-email-transactional-notifications/
Hope this helps.
@voltronik thanks 🙂
I’m reading your post. It’s very interesting.
Perhaps i can use the filter with this code ? This code will change the ‘From’ name and email address for the notification created with your plugin.
function bnfw_change_email_address($email) {
$obj = get_post_type_object( 'bnfw_notification' );
if($obj->labels->name == 'bnfw_notification') {
$email = "[email protected]";
}
return $email;
}
add_filter('wp_mail_from', 'bnfw_change_email_address');
Hi @stardeuche,
The filter on the page I linked to in my last reply comes with the following caveat:
Please be aware though, that by doing this, you may globally affect all notifications that WordPress sends out, possibly including those from BNFW too. Please test appropriately before adding the below code to your website.
So changing the from name and email address using a filter will apply to all emails from your WordPress website, not just those from BNFW, and will override any other settings you have in other BNFW notifications too.
-
This reply was modified 4 years, 11 months ago by
Jack - BNFW.