feat(notification): update email branding to use website type for welcome and password reset emails

This commit is contained in:
2026-08-25 10:40:37 -03:00
parent 0c8419a5eb
commit 78ce263849
4 changed files with 16 additions and 14 deletions

View File

@@ -23,14 +23,15 @@ class NotificationMailService
{
$tenant = Tenant::query()->with('websiteType')->where('codigo', $tenantCode)->firstOrFail();
$user = User::query()->findOrFail($userId);
$brand = $tenant->websiteType ?? $tenant;
$this->mailService
->forTenant($tenantCode)
->send(
$user->email,
"Bienvenido a {$tenant->nombre}",
view('mail.notifications.welcome', compact('tenant', 'user'))->render(),
$tenant->websiteType ?? $tenant,
"Bienvenido a {$brand->nombre}",
view('mail.notifications.welcome', compact('brand', 'user'))->render(),
$brand,
);
}
@@ -76,19 +77,19 @@ class NotificationMailService
$recoveryUrl = $recoveryDomain === null
? null
: 'https://'.$recoveryDomain.$recoveryBasePath.'/recuperar-contrasena/codigo?'.http_build_query($recoveryQuery);
$brand = $tenant->websiteType ?? $tenant;
$this->mailService
->forTenant($tenantCode)
->send(
$attempt->user->email,
"Código para recuperar tu contraseña - {$tenant->nombre}",
"Código para recuperar tu contraseña - {$brand->nombre}",
view('mail.notifications.password-reset', [
'tenant' => $tenant,
'attempt' => $attempt,
'recoveryUrl' => $recoveryUrl,
'brand' => $tenant->websiteType ?? $tenant,
'brand' => $brand,
])->render(),
$tenant->websiteType ?? $tenant,
$brand,
);
}