using WC_Email send method for all WC emails

This commit is contained in:
Patrick Rauland 2014-09-23 11:02:00 -06:00
parent 71c60d6b64
commit 4df8fca1bd
1 changed files with 2 additions and 10 deletions

View File

@ -226,18 +226,10 @@ class WC_Emails {
// Set content type
$this->_content_type = $content_type;
// Filters for the email
add_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
add_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
add_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
// Send
wp_mail( $to, $subject, $message, $headers, $attachments );
$email = new WC_Email();
$email->send( $to, $subject, $message, $headers, $attachments );
// Unhook filters
remove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );
remove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );
remove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );
}
/**