Merge pull request #14344 from woocommerce/remove/defer-email-default
Set default email sending method to not defer
This commit is contained in:
commit
ef8136b135
|
@ -88,7 +88,7 @@ class WC_Emails {
|
|||
'woocommerce_created_customer',
|
||||
) );
|
||||
|
||||
if ( apply_filters( 'woocommerce_defer_transactional_emails', true ) ) {
|
||||
if ( apply_filters( 'woocommerce_defer_transactional_emails', false ) ) {
|
||||
self::$background_emailer = new WC_Background_Emailer();
|
||||
|
||||
foreach ( $email_actions as $action ) {
|
||||
|
@ -139,9 +139,15 @@ class WC_Emails {
|
|||
* @param array $args Email args (default: []).
|
||||
*/
|
||||
public static function send_transactional_email( $args = array() ) {
|
||||
$args = func_get_args();
|
||||
self::instance(); // Init self so emails exist.
|
||||
do_action_ref_array( current_filter() . '_notification', $args );
|
||||
try {
|
||||
$args = func_get_args();
|
||||
self::instance(); // Init self so emails exist.
|
||||
do_action_ref_array( current_filter() . '_notification', $args );
|
||||
} catch ( Exception $e ) {
|
||||
if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
|
||||
trigger_error( 'Transactional email triggered fatal error for callback ' . current_filter(), E_USER_WARNING );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue