diff --git a/plugins/woocommerce/changelog/patch-fix-mobile-messaging b/plugins/woocommerce/changelog/patch-fix-mobile-messaging new file mode 100644 index 00000000000..20e93ff530c --- /dev/null +++ b/plugins/woocommerce/changelog/patch-fix-mobile-messaging @@ -0,0 +1,3 @@ +Significance: patch +Type: fix +Comment: This fixes bug described in https://github.com/woocommerce/woocommerce/issues/35016 diff --git a/plugins/woocommerce/includes/emails/class-wc-email-new-order.php b/plugins/woocommerce/includes/emails/class-wc-email-new-order.php index 86254c02df3..e357c11ff73 100644 --- a/plugins/woocommerce/includes/emails/class-wc-email-new-order.php +++ b/plugins/woocommerce/includes/emails/class-wc-email-new-order.php @@ -227,9 +227,11 @@ if ( ! class_exists( 'WC_Email_New_Order' ) ) : /** * Add mobile messaging. + * + * @param WC_Email $email that called for mobile messaging. May not contain a WC_Email for legacy reasons. */ - public function mobile_messaging() { - if ( null !== $this->object ) { + public function mobile_messaging( $email ) { + if ( $email instanceof WC_Email_New_Order && null !== $this->object ) { $domain = wp_parse_url( home_url(), PHP_URL_HOST ); wc_get_template( 'emails/email-mobile-messaging.php',