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:


