From 54c16b06e7ace7e07500dea14695269321ecd5c9 Mon Sep 17 00:00:00 2001 From: Jeppe Bundgaard Date: Fri, 2 Jan 2026 11:18:10 +0100 Subject: [PATCH] Send wash certificate email to the customer if a booking is associated --- services/nginx/app/routes/orderRoute.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/nginx/app/routes/orderRoute.php b/services/nginx/app/routes/orderRoute.php index e5e90e79..e9296ab7 100644 --- a/services/nginx/app/routes/orderRoute.php +++ b/services/nginx/app/routes/orderRoute.php @@ -98,6 +98,11 @@ class orderRoute // Generate (no-op if already exists) $orders_o->generateWashCertificate($safety_seal, $operator, $date); $now_exists = $orders_o->hasWashCertificateAttached(); + // If a booking is associated, send the wash certificate email to the customer + if ($orders_o->booking_id->value()) { + $order_booking = $orders_o->getOrderBooking(); + $order_booking?->sendWashCertificateToCustomer(); + } (new logs_o())->add('orders', $orders_o->department_id->value(), 1, $user->id, 'GENERATE_ORDER_WASH_CERTIFICATE', 'Wash certificate ' . ($already_exists ? 'already existed' : 'generated'));