Merge pull request #14483 from woocommerce/fix/14476

Adds a fallback to queue_transactional_email if background sending is disabled.
This commit is contained in:
Claudio Sanches 2017-04-18 18:29:33 -03:00 committed by GitHub
commit faaac6d67b
1 changed files with 10 additions and 5 deletions

View File

@ -102,13 +102,18 @@ class WC_Emails {
}
/**
* Queue transactional email so it's not sent in current request.
* Queues transactional email so it's not sent in current request if enabled,
* otherwise falls back to send now.
*/
public static function queue_transactional_email() {
if ( is_a( self::$background_emailer, 'WC_Background_Emailer' ) ) {
self::$background_emailer->push_to_queue( array(
'filter' => current_filter(),
'args' => func_get_args(),
) );
} else {
call_user_func_array( array( __CLASS__, 'send_transactional_email' ), func_get_args() );
}
}
/**