Skip to content

Instantly share code, notes, and snippets.

@sheabunge
Created November 23, 2012 22:50
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 sheabunge/4137632 to your computer and use it in GitHub Desktop.
Save sheabunge/4137632 to your computer and use it in GitHub Desktop.
Change how WordPress sends emails
<?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