X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/8e3f8de6278c455d529f14e8dfb245dd81e3d1aa..refs/pull/5721/head:/app/App/MailNotification.php diff --git a/app/App/MailNotification.php b/app/App/MailNotification.php index 8c57b5621..50b7f69a7 100644 --- a/app/App/MailNotification.php +++ b/app/App/MailNotification.php @@ -2,6 +2,7 @@ namespace BookStack\App; +use BookStack\Translation\LocaleDefinition; use BookStack\Users\Models\User; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; @@ -32,9 +33,9 @@ abstract class MailNotification extends Notification implements ShouldQueue /** * Create a new mail message. */ - protected function newMailMessage(string $language = ''): MailMessage + protected function newMailMessage(?LocaleDefinition $locale = null): MailMessage { - $data = ['language' => $language ?: null]; + $data = ['locale' => $locale ?? user()->getLocale()]; return (new MailMessage())->view([ 'html' => 'vendor.notifications.email',