Created
November 15, 2017 11:08
-
-
Save sarathlal-old/8cf9f7362ff0a9de4848a366826befc0 to your computer and use it in GitHub Desktop.
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
add_filter('wp_mail_from', 'notification_from_email'); | |
add_filter('wp_mail_from_name', 'notification_from_name'); | |
function notification_from_email($email_address){ | |
$blog_url = get_site_url(); | |
$output1 = str_replace(array('http://','https://', 'www'), '', $blog_url); | |
$output2 = strstr($output1, '/', true); | |
if($email_address === "wordpress@" . $output2) | |
return 'noreply@'. $output2; | |
else | |
return $email_address; | |
} | |
function notification_from_name($email_from){ | |
if($email_from === "WordPress") | |
return get_bloginfo( 'name' ); | |
else | |
return $email_from; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment