Send wash certificate email to the customer if a booking is associated

This commit is contained in:
Jeppe Bundgaard
2026-01-02 11:18:10 +01:00
parent bcca9dd319
commit 54c16b06e7
+5
View File
@@ -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'));