diff --git a/static/rsvp-submit.php b/static/rsvp-submit.php index 8a8c40c..5fb4e27 100755 --- a/static/rsvp-submit.php +++ b/static/rsvp-submit.php @@ -1,13 +1,11 @@ load(); -// Collect form data safely $name = $_POST['name'] ?? 'No Name'; $drinks = $_POST['drinks'] ?? 'None'; $allergies = $_POST['allergies'] ?? 'None'; @@ -15,7 +13,6 @@ $allergies = $_POST['allergies'] ?? 'None'; $mail = new PHPMailer(true); try { - // SMTP configuration $mail->isSMTP(); $mail->Host = $_ENV['SMTP_HOST']; $mail->SMTPAuth = true; @@ -24,19 +21,15 @@ try { $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $mail->Port = (int)$_ENV['SMTP_PORT']; - // Email headers $mail->setFrom($_ENV['FROM_EMAIL'], $_ENV['FROM_NAME']); $mail->addAddress($_ENV['TO_EMAIL']); $mail->Subject = "New Wedding RSVP from $name"; - // Optional: guest reply-to if (!empty($_POST['email'])) { $mail->addReplyTo($_POST['email'], $name); } - // Email body $body = "Name: $name\nDrinks: $drinks\nAllergies: $allergies\n"; - $mail->Body = $body; $mail->send();