diff --git a/src/controllers/Password.php b/src/controllers/Password.php index 4f2298f..03de1de 100644 --- a/src/controllers/Password.php +++ b/src/controllers/Password.php @@ -40,11 +40,19 @@ public function __construct() */ private function sendResetEmail(string $email, string $resetLink): void { - //Implement logic to send reset email using Mailer class - $mailer = new Mailer(); $subject = "Reset Your Password | Steamy Sips"; - $htmlMessage = "Click the link below to reset your password:
$resetLink"; + + // Capture the HTML template content + ob_start(); + $userEmail = $email; + require __DIR__ . '/../views/mails/PasswordReset.php'; + $htmlMessage = ob_get_clean(); + + // Plain message as fallback $plainMessage = "Click the link below to reset your password:\n$resetLink"; + + // Send the email + $mailer = new Mailer(); $mailer->sendMail($email, $subject, $htmlMessage, $plainMessage); } diff --git a/src/views/mails/PasswordReset.php b/src/views/mails/PasswordReset.php new file mode 100644 index 0000000..9cddb85 --- /dev/null +++ b/src/views/mails/PasswordReset.php @@ -0,0 +1,98 @@ + + + + + + + + Reset Your Password + + + +
+
+ Steamy Sips Logo +
+
+

Reset Your Password

+

Hello,

+

We received a request to reset the password for the account associated with . Click the button below to reset your password:

+

Reset My Password

+

If you did not request a password reset, please ignore this email. This link will expire in 24 hours.

+

Thank you,
The Steamy Sips Team

+
+ +
+ +