Skip to content

Instantly share code, notes, and snippets.

@mmh4560
Created February 5, 2019 10:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmh4560/e2825d7b04ea8c7f73660e697ecafc4b to your computer and use it in GitHub Desktop.
Save mmh4560/e2825d7b04ea8c7f73660e697ecafc4b to your computer and use it in GitHub Desktop.
// Just add those code in your functions.php file
// Function to change email address
function wpb_sender_email( $original_email_address ) {
return 'tim.smith@example.com';
}
// 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