From 1edde3645c538b3165e863cfcfb48c32f55bfcdc Mon Sep 17 00:00:00 2001 From: Hosteroid Date: Tue, 14 Oct 2025 02:21:04 +0300 Subject: [PATCH] Enhance email templates for verification and reset Updated the email verification and password reset templates to use more visually appealing and structured HTML layouts. These changes improve readability, branding, and user experience for recipients. --- app/Helpers/EmailHelper.php | 120 ++++++++++++++++++++++++++++++------ 1 file changed, 100 insertions(+), 20 deletions(-) diff --git a/app/Helpers/EmailHelper.php b/app/Helpers/EmailHelper.php index e440af1..13d94ed 100644 --- a/app/Helpers/EmailHelper.php +++ b/app/Helpers/EmailHelper.php @@ -334,18 +334,57 @@ class EmailHelper $verifyUrl = $appSettings['app_url'] . '/verify-email?token=' . $token; $subject = 'Verify Your Email Address'; - $message = " -

Welcome to Domain Monitor!

-

Hello {$fullName},

-

Thank you for registering. Please click the link below to verify your email address:

-

Verify Email Address

-

Or copy and paste this URL into your browser:

-

{$verifyUrl}

-

This link will expire in 24 hours.

-

If you did not create an account, please ignore this email.

+ + // Create a properly formatted HTML email + $htmlContent = " +
+
+

🔔 Welcome to {$appSettings['app_name']}!

+
+ +
+

Hello {$fullName},

+ +

+ Thank you for registering with {$appSettings['app_name']}! To complete your account setup, + please verify your email address by clicking the button below: +

+ +
+ + ✅ Verify Email Address + +
+ +
+

+ Or copy and paste this URL into your browser: +

+

+ {$verifyUrl} +

+
+ +
+

+ ⏰ Important: This verification link will expire in 24 hours for security reasons. +

+
+ +

+ If you did not create an account with {$appSettings['app_name']}, please ignore this email. + No further action is required. +

+
+ +
+

This is an automated message from {$appSettings['app_name']}

+ Visit Dashboard +
+
"; - return self::sendNotificationEmail($email, $subject, $message); + return self::sendNotificationEmail($email, $subject, $htmlContent); } catch (\Exception $e) { $errorMessage = "Failed to send verification email: " . $e->getMessage(); @@ -376,18 +415,59 @@ class EmailHelper $resetUrl = $appSettings['app_url'] . '/reset-password?token=' . $token; $subject = 'Reset Your Password'; - $message = " -

Password Reset Request

-

Hello {$fullName},

-

We received a request to reset your password. Click the link below to create a new password:

-

Reset Password

-

Or copy and paste this URL into your browser:

-

{$resetUrl}

-

This link will expire in 1 hour.

-

If you did not request a password reset, please ignore this email and your password will remain unchanged.

+ + // Create a properly formatted HTML email + $htmlContent = " +
+
+

🔒 Password Reset Request

+
+ +
+

Hello {$fullName},

+ +

+ We received a request to reset your password for your {$appSettings['app_name']} account. + If you made this request, click the button below to create a new password: +

+ +
+ + 🔑 Reset Password + +
+ +
+

+ Or copy and paste this URL into your browser: +

+

+ {$resetUrl} +

+
+ +
+

+ ⏰ Important: This password reset link will expire in 1 hour for security reasons. +

+
+ +
+

+ 🔒 Security Notice: If you did not request a password reset, please ignore this email. + Your password will remain unchanged and no action is required. +

+
+
+ +
+

This is an automated message from {$appSettings['app_name']}

+ Visit Dashboard +
+
"; - return self::sendNotificationEmail($email, $subject, $message); + return self::sendNotificationEmail($email, $subject, $htmlContent); } catch (\Exception $e) { $errorMessage = "Failed to send password reset email: " . $e->getMessage();