Created
March 8, 2017 19:59
-
-
Save sarvar/89f117edb33173cf0c3d71fac742a093 to your computer and use it in GitHub Desktop.
How to Change Sender Name in Outgoing WordPress Email
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function to change email address | |
function wpb_sender_email( $original_email_address ) { | |
return '[email protected]'; | |
} | |
// Function to change sender name | |
function wpb_sender_name( $original_email_from ) { | |
return 'Tim Smith'; | |
} | |
// Hooking up our functions to WordPress filters | |
add_filter( 'wp_mail_from', 'wpb_sender_email' ); | |
add_filter( 'wp_mail_from_name', 'wpb_sender_name' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment