diff --git a/admin/header.php b/admin/header.php index 6c1e8f7c..b44a501f 100644 --- a/admin/header.php +++ b/admin/header.php @@ -40,6 +40,9 @@ if (!isset($_SESSION['admin_logged_in']) || $_SESSION['admin_logged_in'] !== tru
Configure the email addresses that receive notifications when users submit the help or driver signup forms.
+ +A new driver has signed up and is awaiting approval.
" . + "Name: {$full_name}
" . + "Email: {$email}
" . + "Phone: {$phone_number}
" . + "Vehicle: {$vehicle_details}
" . + "Please visit the admin panel to review and approve the application.
"; + $text_content = "A new driver has signed up and is awaiting approval.\n\n" . + "Name: {$full_name}\n" . + "Email: {$email}\n" . + "Phone: {$phone_number}\n" . + "Vehicle: {$vehicle_details}\n\n" . + "Please visit the admin panel to review and approve the application."; + + MailService::sendMail($recipients, $subject, $html_content, $text_content); + } + // Redirect to a pending approval page header("Location: driver_pending_approval.php"); exit; diff --git a/header.php b/header.php index 262e0570..81fbf51a 100644 --- a/header.php +++ b/header.php @@ -25,8 +25,8 @@ session_start(); MajuroEatsEmail: {$email}
\nPhone: {$phone}
\nMessage:
\n{$message}
"; $text_content = "Name: {$name}\nEmail: {$email}\nPhone: {$phone}\nMessage:\n{$message}"; - // The recipient's email address. Using environment variable or a default. - $to = getenv('MAIL_TO') ?: 'support@majuroeats.com'; + $db = db(); + $stmt = $db->prepare("SELECT email FROM email_recipients WHERE form_type = ?"); + $stmt->execute(['help']); + $recipients = $stmt->fetchAll(PDO::FETCH_COLUMN); + + if (!empty($recipients)) { + $to = $recipients; + } else { + $to = getenv('MAIL_TO') ?: 'support@majuroeats.com'; + } $result = MailService::sendMail($to, $subject, $html_content, $text_content, ['reply_to' => $email]); diff --git a/hero.php b/hero.php index aee3b438..12630fdd 100644 --- a/hero.php +++ b/hero.php @@ -2,13 +2,12 @@Get your favorite meals delivered anywhere on Majuro Island.
-Enter your address to find restaurants near you.
+MajuroEats delivers only within the main island zone (Rita–Laura).