Siro Logo

Hi $passengerName,

Thank you for booking your ride with Tripz. Here are the details of your recent trip:

DetailValue
Passenger$passengerName
Email$passengerEmail
Phone$passengerPhone
Fee$$fee
Start Location$startLocation ($startNameLocation)
End Location$endLocation ($endNameLocation)
Time of Trip$timeOfTrip
Duration$duration minutes
"; if ($discount > 0) { $bodyEmail .= "

You have received a 12% discount on your trip from $startNameLocation to $endNameLocation. The original fee was $$beforDiscount. Your discounted fee is $$fee.

"; } $bodyEmail .= "

Thank you for using Tripz. We hope you have a great day!

Best regards,
Tripz Team

"; // إعداد البريد $mail = new PHPMailer(true); try { $mail->isSMTP(); $mail->Host = 'smtp.hostinger.com'; $mail->SMTPAuth = true; $mail->Username = getenv('MAIL_USERNAME') ?: 'noreply@siromove.com'; $mail->Password = getenv('MAIL_PASSWORD') ?: ''; $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $mail->Port = 587; $mail->setFrom(getenv('MAIL_FROM_ADDRESS') ?: 'noreply@siromove.com', getenv('MAIL_FROM_NAME') ?: 'Siro'); $mail->addAddress($passengerEmail, $passengerName); $mail->isHTML(true); $mail->Subject = 'Your Tripz Trip Details'; $mail->Body = $bodyEmail; $mail->send(); echo json_encode(["status" => "success", "message" => "Email sent successfully"]); } catch (Exception $e) { echo json_encode(["status" => "error", "message" => $mail->ErrorInfo]); }