Created
November 23, 2012 22:50
-
-
Save sheabunge/4137632 to your computer and use it in GitHub Desktop.
Change how WordPress sends emails
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
<?php | |
/** | |
* Plugin Name: Custom WordPress Email | |
* Plugin URI: https://gist.github.com/4137632 | |
* Description: Change how WordPress sends emails | |
* Author: Shea Bunge | |
* Author URI: http://bungeshea.com | |
* Version: 1.0 | |
*/ | |
// set email type to html | |
function change_mail_type() { | |
return 'text/html'; | |
} | |
add_filter( 'wp_mail_content_type', 'change_mail_type' ); | |
// set email from address | |
function change_mail_from() { | |
return get_bloginfo( 'admin_email' ); | |
} | |
add_filter( 'wp_mail_from', 'change_mail_from' ); | |
// set email from name | |
function change_from_name() { | |
return get_bloginfo( 'name' ); | |
} | |
add_filter( 'wp_mail_from_name', 'change_from_name' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment