Dear {$customer_name},
Your work order for {$job_type} has been completed.
Thank you for your business!
"; MailService::sendMail($customer_email, $subject, $body); } if ($technician_id != $original_work_order['assigned_technician_id']) { $technician_user = get_user_by_id($technician_id); if ($technician_user && !empty($technician_user['email'])) { $subject = "You have been assigned a new work order"; $body = "Hello {$technician_user['username']},
You have been assigned to a new work order #{$id}.
Click here to view the details.
"; MailService::sendMail($technician_user['email'], $subject, $body); } } header("Location: work_order_details.php?id=" . $id . "&success=1"); exit; } else { $error_message = "Failed to update work order."; } } if (!$work_order) { header("Location: index.php?error=notfound"); exit; } ?>