feat(notification): implement branding for emails using WebsiteType and update templates
This commit is contained in:
@@ -21,7 +21,7 @@ class NotificationMailService
|
||||
|
||||
public function sendWelcome(int $userId, string $tenantCode): void
|
||||
{
|
||||
$tenant = Tenant::query()->where('codigo', $tenantCode)->firstOrFail();
|
||||
$tenant = Tenant::query()->with('websiteType')->where('codigo', $tenantCode)->firstOrFail();
|
||||
$user = User::query()->findOrFail($userId);
|
||||
|
||||
$this->mailService
|
||||
@@ -30,6 +30,7 @@ class NotificationMailService
|
||||
$user->email,
|
||||
"Bienvenido a {$tenant->nombre}",
|
||||
view('mail.notifications.welcome', compact('tenant', 'user'))->render(),
|
||||
$tenant->websiteType ?? $tenant,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -81,7 +82,13 @@ class NotificationMailService
|
||||
->send(
|
||||
$attempt->user->email,
|
||||
"Código para recuperar tu contraseña - {$tenant->nombre}",
|
||||
view('mail.notifications.password-reset', compact('tenant', 'attempt', 'recoveryUrl'))->render(),
|
||||
view('mail.notifications.password-reset', [
|
||||
'tenant' => $tenant,
|
||||
'attempt' => $attempt,
|
||||
'recoveryUrl' => $recoveryUrl,
|
||||
'brand' => $tenant->websiteType ?? $tenant,
|
||||
])->render(),
|
||||
$tenant->websiteType ?? $tenant,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user