Files
Siro/walletintaleq.intaleq.xyz/v2/main/Admin/sendEmailToDrivertransaction.php
2026-06-11 18:22:59 +03:00

80 lines
2.7 KiB
PHP

<?php
// File: send_payment_received_email.php
// Connect to the database
include '../connect.php';
// Get trip details from the database or API
$driverID = filterRequest('driverID');
$totalAmount = filterRequest('total_amount');
$driverPhone = filterRequest('phone');
$driverArabicName = filterRequest('name_arabic');
$accountBank = filterRequest('accountBank');
$driverEmail = filterRequest('email');
// Determine the language preference
$language = 'en'; // Default to English
// Email content
$bodyEmail = "<html>
<head>
<style>
/* Email styling here */
</style>
</head>
<body>
<div class='container'>
<img src='https://lh3.googleusercontent.com/a/ACg8ocLe5TgvmTjoFx7KjIoWGxX0G2ryKBTzUZi2-mBYb9DI1dsKQ0WEYh5ZPdnA3WeFbp9VnaTNzJuA0w8S4RiQ7042AKrOwXo3=s576-c-no' style='width: 150px; margin: 20px auto; display: block;'>
<h1>Payment Sent - SEFER</h1>
<p>Thank you for being a valued driver on the SEFER platform.</p>
<p>SEFER has sent a payment of $totalAmount to your account. Please note that it may take a few days for the bank to process this transaction.</p>
<p>We appreciate your service and hope to continue our partnership.</p>
<p>Regards,<br> SEFER Team</p>
</div>
</body>
</html>";
// Arabic email content
$bodyEmailAr = "<html>
<head>
<style>
/* Arabic email styling here */
</style>
</head>
<body dir='rtl'>
<div class='container'>
<img src='YOUR_SEFER_LOGO_URL_HERE' alt='SEFER' style='width: 150px; margin: 20px auto; display: block;'>
<h1>تم إرسال الدفع - سفر</h1>
<p>شكراً لك على كونك سائقًا متميزًا على منصة سفر.</p>
<p>لقد أرسلت سفر دفعة قدرها $totalAmount إلى حسابك. يرجى ملاحظة أنه قد يستغرق البنك عدة أيام لمعالجة هذه المعاملة.</p>
<p>نحن نقدر خدمتك ونأمل أن نستمر في شراكتنا.</p>
<p>مع خالص التحية،<br> فريق سفر</p>
</div>
</body>
</html>";
// Set the email headers
$supportEmail = 'seferteam@sefer.live';
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
$headers .= "From: $supportEmail\r\n";
// Send email to the driver
if (!empty($driverEmail)) {
if (mail($driverEmail, "Payment Sent - SEFER", $bodyEmail, $headers)) {
// echo "Email sent successfully to $driverEmail";
printSuccess($message = "'Email sent successfully to ' . $driverEmail");
} else {
printFailure($message = "Failed to send email to ' . $driverEmail");
}
} else {
printFailure($message = "Invalid email address: ' . $driverEmail");
}
?>