diff --git a/apply.php b/apply.php deleted file mode 100644 index 179ad4e..0000000 --- a/apply.php +++ /dev/null @@ -1,65 +0,0 @@ -prepare( - 'INSERT INTO applications (name, company, email, role) VALUES (?, ?, ?, ?)' - ); - $stmt->execute([$name, $company, $email, $role]); -} catch (PDOException $e) { - // In a real app, log this error. For now, redirect with a generic error. - error_log('DB Error: ' . $e->getMessage()); - header('Location: index.php?error=' . urlencode('A database error occurred.') . '#apply'); - exit; -} - -// 3. Email Notification -$to = getenv('MAIL_TO') ?: null; // Use admin email from .env -$subject = 'New FinMox Founding Access Application'; -$htmlBody = " -

New Application Received

-

A new application has been submitted for FinMox founding access:

- -"; -$textBody = "New Application:\nName: $name\nCompany: $company\nEmail: $email\nRole: $role"; - -// Use MailService, but don't block the user if it fails -try { - MailService::sendMail($to, $subject, $htmlBody, $textBody); -} catch (Exception $e) { - // Log email error but don't prevent user from seeing success - error_log('MailService Error: ' . $e->getMessage()); -} - - -// 4. Redirect to Success -header('Location: index.php?status=applied#apply'); -exit; - diff --git a/index.php b/index.php index 976b8f8..466b27d 100644 --- a/index.php +++ b/index.php @@ -637,13 +637,172 @@ - - + +