Skip to content

Instantly share code, notes, and snippets.

@khelil
Last active November 17, 2017 16:44
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 khelil/72cfd58889a6217d0bb9ec90ec71f085 to your computer and use it in GitHub Desktop.
Save khelil/72cfd58889a6217d0bb9ec90ec71f085 to your computer and use it in GitHub Desktop.
Customise WordPress system email sender informations
<?php
// Function to change email sender
function new_sender_email( $original_email_address ) {
return 'hello@custom.com';
}
// 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