From 0f31f63658f705efca0934f3b9efb90b838d841c Mon Sep 17 00:00:00 2001 From: Fernando Morgenstern Date: Mon, 27 Jul 2026 08:06:16 -0300 Subject: [PATCH] Fix fatal error in cart completed background job on PHP 8 --- CHANGELOG.md | 5 +++++ inc/class-mailrelay-woocommerce.php | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b8a87eec..e84424d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] + +### Fixed +- Fixed fatal error on PHP 8 when marking a WooCommerce cart as completed after an order is placed + ## [3.0.1] - 2025-08-07 ### Fixed diff --git a/inc/class-mailrelay-woocommerce.php b/inc/class-mailrelay-woocommerce.php index 1e9c31dd..dc26c0aa 100644 --- a/inc/class-mailrelay-woocommerce.php +++ b/inc/class-mailrelay-woocommerce.php @@ -93,12 +93,12 @@ function ( $cart_data ) { add_action( 'mailrelay_sync_cart_completed_background', - function ( $data ) { + function ( $cart_id, $email ) { $service = new MailrelayWoocommerceCart(); - $service->set_completed( $data['cart_id'], $data['email'] ); + $service->set_completed( $cart_id, $email ); }, 10, - 1 + 2 ); }