Overview
User notifications handle account-related events including registration, authentication, and account status changes.Notification Classes
WelcomeNotification
File:app/Notifications/WelcomeNotification.php
Purpose: Welcomes new users to NutriFit after successful registration.
Recipient: Newly registered user
Trigger: After user completes registration
Constructor Parameters:
- Subject: ”🎉 ¡Bienvenido a NutriFit!”
- Greeting: “¡Hola !”
- Message: Welcome message and account creation confirmation
- Features Highlighted:
- ✅ Agendar citas con nutricionistas profesionales
- ✅ Mantener tu historial clínico organizado
- ✅ Recibir seguimiento continuo de tu progreso
- Call to Action: “Explorar NutriFit” →
/paciente/dashboard - Additional Note: Invitation to contact support if needed
- Salutation: “¡Bienvenido al equipo! NutriFit”
VerifyEmailNotification
File:app/Notifications/VerifyEmailNotification.php
Purpose: Sends email verification link to confirm user’s email address.
Recipient: Newly registered user (before email verification)
Trigger: After user registration or when requesting new verification link
Base Class: Extends Illuminate\Auth\Notifications\VerifyEmail
Email Content:
- Subject: ”✅ Verifica tu Correo Electrónico - NutriFit”
- Greeting: “¡Hola !”
- Message: Verification request with instructions
- Call to Action: “Verificar Correo Electrónico” →
{verification_url} - Expiration Notice: Link expires in 60 minutes
- Security Note: Safe to ignore if user didn’t register
- Salutation: “¡Te esperamos! NutriFit”
ResetPasswordNotification
File:app/Notifications/ResetPasswordNotification.php
Purpose: Sends password reset link when user requests to reset their password.
Recipient: User who requested password reset
Trigger: When user submits forgot password form
Constructor Parameters:
- Subject: “Restablecer Contraseña - NutriFit”
- Greeting: “¡Hola!”
- Message: Explanation that password reset was requested
- Call to Action: “Restablecer Contraseña” →
{reset_url} - Expiration Notice: Link expires in 60 minutes
- Security Note: No action needed if request wasn’t made by user
- Salutation: “Saludos, NutriFit”
PasswordChangedNotification
File:app/Notifications/PasswordChangedNotification.php
Purpose: Confirms successful password change and alerts user to potential unauthorized access.
Recipient: User whose password was changed
Trigger: After successful password update
Constructor Parameters:
- Subject: ”🔐 Contraseña Actualizada - NutriFit”
- Greeting: “¡Hola !”
- Message: Confirmation of password update
- Security Alert: Instructions if change was unauthorized
- Timestamp: Date and time of password change (formatted as
d/m/Y H:i:s) - Call to Action: “Ir a Mi Cuenta” →
/paciente/perfil - Security Reminder: Never share password
- Salutation: “Saludos, NutriFit”
UserAccountEnabledNotification
File:app/Notifications/UserAccountEnabledNotification.php
Purpose: Notifies user when their account is enabled/reactivated by an administrator.
Recipient: User whose account was enabled
Trigger: When administrator enables a previously disabled account
Constructor Parameters:
- Subject: ”✅ Tu cuenta ha sido habilitada - NutriFit”
- Greeting: “¡Hola !”
- Message: Account has been enabled/reactivated
- Permissions Restored:
- ✅ Iniciar sesión en la plataforma
- ✅ Acceder a todas las funcionalidades
- ✅ Continuar usando tu cuenta con normalidad
- Call to Action: “Ir a mi Dashboard” → Role-based dashboard URL
- Salutation: “Bienvenido nuevamente, NutriFit”
UserAccountDisabledNotification
File:app/Notifications/UserAccountDisabledNotification.php
Purpose: Notifies user when their account is disabled by an administrator.
Recipient: User whose account was disabled
Trigger: When administrator disables a user account
Constructor Parameters:
- Subject: “⚠️ Tu cuenta ha sido deshabilitada - NutriFit”
- Greeting: “Hola ,”
- Message: Account has been disabled by administrator
- Consequences Explained:
- • No podrás iniciar sesión en la plataforma
- • No podrás agendar nuevas citas
- • Tus citas pendientes podrían verse afectadas
- Call to Action: “Contactar Soporte” →
/contacto - Additional Note: Instructions to contact administrator if it’s an error
- Salutation: “Atentamente, NutriFit”
Additional User Notifications
PersonalDataCreatedNotification
File:app/Notifications/PersonalDataCreatedNotification.php
Notifies users when their personal data profile is created. (Implementation details not shown in source code review)
ContactFormNotification
File:app/Notifications/ContactFormNotification.php
Notifies administrators when a user submits the contact form. (Implementation details not shown in source code review)
Authentication Flow
Registration Flow
- User submits registration form
- WelcomeNotification sent immediately
- VerifyEmailNotification sent immediately
- User clicks verification link
- Account becomes fully active
Password Reset Flow
- User requests password reset
- ResetPasswordNotification sent with token
- User clicks reset link (valid for 60 minutes)
- User submits new password
- PasswordChangedNotification sent as confirmation
Account Status Flow
- Administrator changes account status
- UserAccountEnabledNotification or UserAccountDisabledNotification sent
- User receives email explaining the change
- User can contact support if needed
Security Considerations
Email Verification
- Verification links are signed URLs with timestamp and hash
- Links expire after 60 minutes
- Laravel validates signature before allowing verification
- Prevents tampering and replay attacks
Password Reset
- Reset tokens are stored hashed in database
- Tokens expire after 60 minutes
- Tokens are single-use only
- Old tokens invalidated when new one requested
Password Change Notification
- Always sent after password change
- Helps detect unauthorized access
- Includes timestamp for audit trail
- Instructs user to contact admin if unauthorized
Account Status Changes
- Clear communication about access restrictions
- Provides contact information for support
- Documents reason for change where applicable
Best Practices
- Always send password change notifications for security
- Make verification links time-limited to prevent abuse
- Use signed URLs for sensitive actions
- Provide clear next steps in every notification
- Include support contact information when access is restricted
- Use role-based URLs for better user experience
- Implement rate limiting on password reset requests
- Log all account status changes for audit trail
- Test email delivery in staging before production
- Monitor failed notification deliveries for email issues