Last active
November 17, 2017 16:44
-
-
Save khelil/72cfd58889a6217d0bb9ec90ec71f085 to your computer and use it in GitHub Desktop.
Customise WordPress system email sender informations
This file contains hidden or 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
<?php | |
// Function to change email sender | |
function new_sender_email( $original_email_address ) { | |
return '[email protected]'; | |
} | |
// Function to change sender name | |
function new_sender_name( $original_email_from ) { | |
return 'Custom Name'; | |
} | |
// Hooking up our functions to WordPress filters | |
add_filter( 'wp_mail_from', __NAMESPACE__ . '\\new_sender_email' ); | |
add_filter( 'wp_mail_from_name', __NAMESPACE__ . '\\new_sender_name' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment