diff --git a/app/Observers/UserActivityObserver.php b/app/Observers/UserActivityObserver.php index a3b32178b..20db48180 100644 --- a/app/Observers/UserActivityObserver.php +++ b/app/Observers/UserActivityObserver.php @@ -2,6 +2,7 @@ namespace App\Observers; +use App\Jobs\SendAccountChangedEmail; use App\Models\User; use App\Models\UserActivity; @@ -51,6 +52,9 @@ class UserActivityObserver 'updated_by' => auth()->user()?->username ?? 'System', ], ]); + + // Send email notification to user about role change + SendAccountChangedEmail::dispatch($user); } } diff --git a/resources/views/emails/accountAboutToExpire.blade.php b/resources/views/emails/accountAboutToExpire.blade.php index 89c630880..ddcd98dc3 100644 --- a/resources/views/emails/accountAboutToExpire.blade.php +++ b/resources/views/emails/accountAboutToExpire.blade.php @@ -1,13 +1,24 @@ @extends('emails.email_layout') @section('title') - Your account is about to expire + Account Expiration Notice @endsection +@section('site_name', $site) + @section('content') - Dear {{ $username }}, -
- Your account role {{ $account }} is about to expire in less than {{ $days }} day(s). -


- Greetings from {{ $site }} +

Dear {{ $username }},

+ +
+ ⚠️ Attention Required: Your account role {{ $account }} is about to expire in less than {{ $days }} day(s). +
+ +

To continue enjoying uninterrupted access to all your current features and benefits, please take action before your subscription expires.

+ +

If you have any questions about renewing your account or need assistance, please don't hesitate to contact us.

+ +
+

Best regards,

+

The {{ $site }} Team

+
@endsection diff --git a/resources/views/emails/accountChange.blade.php b/resources/views/emails/accountChange.blade.php index e56114831..768112282 100644 --- a/resources/views/emails/accountChange.blade.php +++ b/resources/views/emails/accountChange.blade.php @@ -1,13 +1,26 @@ @extends('emails.email_layout') @section('title') - Your account level has been changed + Account Level Changed @endsection +@section('site_name', $site) + @section('content') - Dear {{ $username }}, -
- Your account has been changed to {{ $account }} -


- Greetings from {{ $site }} +

Dear {{ $username }},

+ +

We wanted to let you know that your account level has been updated.

+ +
+ 🔄 New Account Level: {{ $account }} +
+ +

Your new account level is now active, and you can start enjoying all the associated features and benefits immediately.

+ +

If you have any questions about your new account level or need assistance, please don't hesitate to contact us.

+ +
+

Best regards,

+

The {{ $site }} Team

+
@endsection diff --git a/resources/views/emails/accountDelete.blade.php b/resources/views/emails/accountDelete.blade.php index 9a32bcf36..961ad5cde 100644 --- a/resources/views/emails/accountDelete.blade.php +++ b/resources/views/emails/accountDelete.blade.php @@ -1,9 +1,22 @@ @extends('emails.email_layout') @section('title') - User Account deleted + User Account Deleted @endsection +@section('site_name', $site) + @section('content') - User {{ $username }} has deleted his/hers account from {{ $site }}. +

This is a notification that a user has deleted their account from {{ $site }}.

+ +
+ 👤 Deleted Account: {{ $username }} +
+ +

No further action is required. This email is for informational purposes only.

+ +
+

Best regards,

+

The {{ $site }} System

+
@endsection diff --git a/resources/views/emails/accountExpired.blade.php b/resources/views/emails/accountExpired.blade.php index 077d4c675..2ede4244f 100644 --- a/resources/views/emails/accountExpired.blade.php +++ b/resources/views/emails/accountExpired.blade.php @@ -1,13 +1,26 @@ @extends('emails.email_layout') @section('title') - Your account has expired and account level has been downgraded + Account Expired @endsection +@section('site_name', $site) + @section('content') - Dear {{ $username }}, -
- Your account has expired and has been downgraded to {{ $account }} -


- Greetings from {{ $site }} +

Dear {{ $username }},

+ +

We regret to inform you that your account subscription has expired.

+ +
+ 📉 Account Downgraded: Your account has been automatically downgraded to {{ $account }}. +
+ +

Don't worry – you can still access the site with your downgraded account level. If you'd like to regain access to all your previous features and benefits, please consider renewing your subscription.

+ +

If you have any questions or need assistance with the renewal process, please don't hesitate to contact us.

+ +
+

Best regards,

+

The {{ $site }} Team

+
@endsection diff --git a/resources/views/emails/contactUs.blade.php b/resources/views/emails/contactUs.blade.php index cd318abfe..475652928 100644 --- a/resources/views/emails/contactUs.blade.php +++ b/resources/views/emails/contactUs.blade.php @@ -1,9 +1,18 @@ @extends('emails.email_layout') @section('title') - Contact form submitted + Contact Form Submission @endsection @section('content') - {!! nl2br(e($mailBody)) !!} +

A new contact form has been submitted.

+ +
+ 📝 Message: +
+ {!! nl2br(e($mailBody)) !!} +
+
+ +

Please respond to this inquiry at your earliest convenience.

@endsection diff --git a/resources/views/emails/email_layout.blade.php b/resources/views/emails/email_layout.blade.php index 73819be96..77bad10db 100644 --- a/resources/views/emails/email_layout.blade.php +++ b/resources/views/emails/email_layout.blade.php @@ -1,49 +1,152 @@ - - @yield('title') - - - - + + + @yield('title') -
-
- @yield('content') + -
- \ No newline at end of file + diff --git a/resources/views/emails/forgottenPassword.blade.php b/resources/views/emails/forgottenPassword.blade.php index ec5498ce3..fa9ef8a62 100644 --- a/resources/views/emails/forgottenPassword.blade.php +++ b/resources/views/emails/forgottenPassword.blade.php @@ -1,14 +1,29 @@ @extends('emails.email_layout') @section('title') - Forgotten Password + Password Reset Request @endsection +@section('site_name', $site) + @section('content') +

Hello,

- Someone has requested a password reset for this email address. -
- To reset the password use the following link: {{$resetLink}}
-


- Greetings from {{ $site }} +

We received a request to reset the password associated with this email address.

+ +
+ Reset Password +
+ +

Or copy and paste this link into your browser:

+ {{ $resetLink }} + +
+ 🔒 Security Notice: If you didn't request this password reset, you can safely ignore this email. Your password will remain unchanged. +
+ +
+

Best regards,

+

The {{ $site }} Team

+
@endsection diff --git a/resources/views/emails/invitation.blade.php b/resources/views/emails/invitation.blade.php index 5bfb285dc..1ebad59eb 100644 --- a/resources/views/emails/invitation.blade.php +++ b/resources/views/emails/invitation.blade.php @@ -1,99 +1,35 @@ - - - - - - Invitation to {{ $siteName }} - - - -
-

You're Invited!

-

{{ $invitedBy->username }} has invited you to join {{ $siteName }}

+@extends('emails.email_layout') + +@section('title') + You're Invited to {{ $siteName }}! +@endsection + +@section('site_name', $siteName) + +@section('content') +

Hello!

+ +

Great news! {{ $invitedBy->username }} has invited you to join {{ $siteName }}, our exclusive community.

+ +
+ Accept Invitation
-
-

Welcome to {{ $siteName }}

+

Or copy and paste this link into your browser:

+ {{ $registerUrl }} -

Hello!

+
+ ⚠️ Important: This invitation will expire on {{ $expiresAt->format('F j, Y \a\t g:i A') }}. Please complete your registration before this date. +
-

You have been invited by {{ $invitedBy->username }} to join {{ $siteName }}, our exclusive community.

+
+ 💡 What's Next? Click the button above to create your account and start exploring everything {{ $siteName }} has to offer. +
-

To accept this invitation and create your account, click the button below:

- -
- Accept Invitation -
- -

Or copy and paste this link into your browser:

-

- {{ $registerUrl }} -

- -
- ⚠️ Important: This invitation will expire on {{ $expiresAt->format('F j, Y \a\t g:i A') }}. - Please complete your registration before this date. -
- -

If you have any questions, please don't hesitate to contact us.

+

If you have any questions, please don't hesitate to contact us after registering.

+

Welcome aboard!

-

The {{ $siteName }} Team

+

The {{ $siteName }} Team

- - - - +@endsection diff --git a/resources/views/emails/newAccountCreated.blade.php b/resources/views/emails/newAccountCreated.blade.php index 1624ee6c3..f7a0ed707 100644 --- a/resources/views/emails/newAccountCreated.blade.php +++ b/resources/views/emails/newAccountCreated.blade.php @@ -1,9 +1,22 @@ @extends('emails.email_layout') @section('title') - New user registered + New User Registration @endsection +@section('site_name', $site) + @section('content') - User {{ $username }} has registered a new account on {{ $site }}. +

A new user has registered on {{ $site }}.

+ +
+ 👤 New User: {{ $username }} +
+ +

This is an automated notification. No action is required unless you need to review the new registration.

+ +
+

Best regards,

+

The {{ $site }} System

+
@endsection diff --git a/resources/views/emails/passwordReset.blade.php b/resources/views/emails/passwordReset.blade.php index 92af3c262..b6ff89128 100644 --- a/resources/views/emails/passwordReset.blade.php +++ b/resources/views/emails/passwordReset.blade.php @@ -1,13 +1,29 @@ @extends('emails.email_layout') @section('title') - Forgotten Password + Password Reset Successful @endsection +@section('site_name', $site) + @section('content') - Dear {{ $userName }}, -
- Your password has been reset to: {{ $newPass }} -


- Greetings from {{ $site }} +

Dear {{ $userName }},

+ +

Your password has been successfully reset.

+ +
+ 🔑 Your New Password: +
{{ $newPass }}
+
+ +
+ 🔒 Security Recommendation: For your security, we strongly recommend changing this password to something memorable after logging in. +
+ +

If you did not request this password reset, please contact us immediately.

+ +
+

Best regards,

+

The {{ $site }} Team

+
@endsection diff --git a/resources/views/emails/sendinvite.blade.php b/resources/views/emails/sendinvite.blade.php index 2eb65f284..9f957c5cb 100644 --- a/resources/views/emails/sendinvite.blade.php +++ b/resources/views/emails/sendinvite.blade.php @@ -1,15 +1,31 @@ @extends('emails.email_layout') @section('title') - You have received an invite + You've Been Invited! @endsection +@section('site_name', $site) + @section('content') - Dear {{ $email }}, -
- you have received an invite from {{ $username }} to register on {{ $site }} -
- To register click on following link: {{$invite}}
-


- Greetings from {{ $site }} +

Hello {{ $email }},

+ +

Great news! {{ $username }} has invited you to join {{ $site }}.

+ +
+ Accept Invitation +
+ +

Or copy and paste this link into your browser:

+ {{ $invite }} + +
+ 💡 What's Next? Click the button above to create your account and start exploring everything {{ $site }} has to offer. +
+ +

If you have any questions, feel free to reach out to us after registering.

+ +
+

Best regards,

+

The {{ $site }} Team

+
@endsection diff --git a/resources/views/emails/welcome.blade.php b/resources/views/emails/welcome.blade.php index 7a890239c..fd5871359 100644 --- a/resources/views/emails/welcome.blade.php +++ b/resources/views/emails/welcome.blade.php @@ -4,10 +4,21 @@ Welcome to {{ $site }} @endsection +@section('site_name', $site) + @section('content') - Dear {{ $username }}, -
- Welcome to our site. Your account verification will be sent in separate email. -


- Greetings from {{ $site }} +

Dear {{ $username }},

+ +

Welcome to {{ $site }}! We're thrilled to have you join our community.

+ +
+ 📧 Next Step: Your account verification email will be sent separately. Please check your inbox and verify your email address to complete the registration process. +
+ +

If you have any questions or need assistance, don't hesitate to reach out to us.

+ +
+

Best regards,

+

The {{ $site }} Team

+
@endsection