feat(notification): enhance password reset emails with custom templates for different scenarios

This commit is contained in:
2026-09-04 10:31:16 -03:00
parent 18f1217daa
commit 7acef66ee7
7 changed files with 113 additions and 47 deletions

View File

@@ -0,0 +1,6 @@
@include('mail.notifications.partials.password-action', [
'title' => 'Desbloqueá tu cuenta',
'description' => 'registramos varios intentos fallidos de inicio de sesión en tu cuenta. Por seguridad, bloqueamos el acceso temporalmente. Utilizá este código para cambiar tu contraseña y desbloquearla.',
'buttonLabel' => 'Ingresar código ahora',
'footer' => 'Si no fuiste vos, por favor desestimá y borrá este correo. Tu cuenta seguirá protegida.',
])

View File

@@ -0,0 +1,6 @@
@include('mail.notifications.partials.password-action', [
'title' => 'Tu cuenta de administrador está lista',
'description' => 'creamos tu cuenta de administrador en '.$brand->nombre.'. Creá tu contraseña con este código para ingresar al panel de administración.',
'buttonLabel' => 'Crear mi contraseña',
'footer' => 'Si no esperabas recibir una cuenta de administrador, podés ignorar este mensaje.',
])

View File

@@ -0,0 +1,24 @@
<h1 style="margin: 0 0 20px; color: {{ $brand->primary_color }};">
{{ $title }}
</h1>
<p>Hola {{ $attempt->user->nombre_apellido }}, {{ $description }}</p>
<p>Ingresá este código en {{ $brand->nombre }}:</p>
<div style="margin: 28px 0; padding: 20px; border: 2px solid {{ $brand->primary_color }}; border-radius: 8px; text-align: center;">
<span style="color: {{ $brand->primary_color }}; font-size: 36px; font-weight: 700; letter-spacing: 12px;">
{{ $attempt->codigo }}
</span>
</div>
@if($recoveryUrl)
<div style="text-align: center; margin-bottom: 28px;">
<a href="{{ $recoveryUrl }}"
style="display: inline-block; padding: 12px 24px; background-color: {{ $brand->primary_color }}; color: #ffffff; text-decoration: none; border-radius: 6px; font-weight: bold;">
{{ $buttonLabel }}
</a>
</div>
@endif
<p style="color: #64748b; font-size: 14px;">{{ $footer }}</p>

View File

@@ -1,45 +1,6 @@
<h1 style="margin: 0 0 20px; color: {{ $brand->primary_color }};">
Recuperá tu contraseña
</h1>
@if($attempt->reason === \App\Domains\Auth\Models\ResetPasswordAttempt::REASON_STAFF_CREATED)
<p>
Hola {{ $attempt->user->nombre_apellido }}, creamos tu cuenta de scanner en {{ $brand->nombre }}. Utilizá este código para crear tu contraseña y comenzar a usarla.
</p>
@elseif($attempt->reason === \App\Domains\Auth\Models\ResetPasswordAttempt::REASON_ACCOUNT_LOCKED)
<p>
Hola {{ $attempt->user->nombre_apellido }}, registramos varios intentos fallidos de inicio de sesión en tu cuenta. Por seguridad, hemos bloqueado el acceso temporalmente. Puedes utilizar este código para cambiar tu contraseña y desbloquearla inmediatamente.
</p>
@else
<p>
Hola {{ $attempt->user->nombre_apellido }}, recibimos una solicitud para restablecer
la contraseña de tu cuenta.
</p>
@endif
<p>Ingresá este código en {{ $brand->nombre }}:</p>
<div style="margin: 28px 0; padding: 20px; border: 2px solid {{ $brand->primary_color }}; border-radius: 8px; text-align: center;">
<span style="color: {{ $brand->primary_color }}; font-size: 36px; font-weight: 700; letter-spacing: 12px;">
{{ $attempt->codigo }}
</span>
</div>
@if($recoveryUrl)
<div style="text-align: center; margin-bottom: 28px;">
<a href="{{ $recoveryUrl }}"
style="display: inline-block; padding: 12px 24px; background-color: {{ $brand->primary_color }}; color: #ffffff; text-decoration: none; border-radius: 6px; font-weight: bold;">
{{ $attempt->reason === \App\Domains\Auth\Models\ResetPasswordAttempt::REASON_STAFF_CREATED ? 'Crear mi contraseña' : 'Ingresar código ahora' }}
</a>
</div>
@endif
<p style="color: #64748b; font-size: 14px;">
@if($attempt->reason === \App\Domains\Auth\Models\ResetPasswordAttempt::REASON_ACCOUNT_LOCKED)
Si no fuiste vos, por favor desestimá y borrá este correo. Tu cuenta seguirá protegida.
@elseif($attempt->reason === \App\Domains\Auth\Models\ResetPasswordAttempt::REASON_STAFF_CREATED)
Si no esperabas recibir una cuenta de scanner, podés ignorar este mensaje.
@else
Si no solicitaste recuperar tu contraseña, podés ignorar este mensaje.
@endif
</p>
@include('mail.notifications.partials.password-action', [
'title' => 'Recuperá tu contraseña',
'description' => 'recibimos una solicitud para restablecer la contraseña de tu cuenta.',
'buttonLabel' => 'Ingresar código ahora',
'footer' => 'Si no solicitaste recuperar tu contraseña, podés ignorar este mensaje.',
])

View File

@@ -0,0 +1,6 @@
@include('mail.notifications.partials.password-action', [
'title' => 'Tu cuenta de escáner está lista',
'description' => 'creamos tu cuenta de escáner en '.$brand->nombre.'. Creá tu contraseña con este código para ingresar y comenzar a escanear entradas.',
'buttonLabel' => 'Crear mi contraseña',
'footer' => 'Si no esperabas recibir una cuenta de escáner, podés ignorar este mensaje.',
])