Skip to content

Commit

Permalink
Merge pull request woocommerce#5195 from bolderelements/patch-1
Browse files Browse the repository at this point in the history
Update abstract-wc-email.php
  • Loading branch information
mikejolley committed Mar 24, 2014
2 parents df3b60c + 4ce392c commit d9eff07
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions includes/abstracts/abstract-wc-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,18 +542,20 @@ function get_from_address() {
* @param mixed $message
* @param string $headers
* @param string $attachments
* @return void
* @return bool
*/
function send( $to, $subject, $message, $headers, $attachments ) {
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' ) );

wp_mail( $to, $subject, $message, $headers, $attachments );
$return = wp_mail( $to, $subject, $message, $headers, $attachments );

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' ) );

return $return;
}

/**
Expand Down

0 comments on commit d9eff07

Please sign in to comment.