How can change the from email id for all email alert. Currently it take default pressbooks and it goes to spam folder, we want to change it to an validated email
This is where the email is set: https://github.com/pressbooks/pressbooks/blob/a6b5f5028cf034002a15f6c4b4977cf4b8fb64e9/inc/utility/namespace.php#L906-L926
So, you can use your own custom address by adding this to your wp-config.php
:
define( 'WP_MAIL_FROM', 'youremail@yourdomain.com' );
Thank you @nedâŚvery much appreciatedâŚ
The Sender name in the emails goes from here
function mail_from_name( $name ) {
if ( defined( âWP_MAIL_FROM_NAMEâ ) ) {
$name = WP_MAIL_FROM_NAME;
} else {
$name = âPressbooksâ;
}
return $name;
Is nât the Sender name should be of the default âSitenameââŚCurrently the sender name goes as âPressbooksâ
The default from name in WordPress is WordPress
, so we followed the same pattern (see line 258 here). You can change it by doing exactly the same thing I showed you how to do in my previous post, defining WP_MAIL_FROM_NAME
to whatever youâd like in wp-config.php.
define( âWP_MAIL_FROMâ, âyouremail@yourdomain.comâ ); âThis works perfectly fine
define( âWP_MAIL_FROM_NAMEâ, âyourdomainnameâ ); âThis did not work, still pressbook names comes in the nameâŚDId I make any mistake ?
Your email screenshots are error logs. We hardcode âPressbooksâ there because these are system logs. We do this because we want to know these come from Pressbooks the system, and not marketing or support. The code is here: