mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-07 23:03:00 +03:00
Notifications: Aligned how user language is used
- This ensures content notifications are not translated to receiver language. - This adds actual plaintext support for content notifications (Was previously just HTML as text view). - Shares same base class across all mail notifications. - Also cleaned up existing notification classes. Future cleanup requested via #4501
This commit is contained in:
@@ -11,6 +11,7 @@ use BookStack\App\Model;
|
||||
use BookStack\App\Sluggable;
|
||||
use BookStack\Entities\Tools\SlugGenerator;
|
||||
use BookStack\Notifications\ResetPassword;
|
||||
use BookStack\Translation\LanguageManager;
|
||||
use BookStack\Uploads\Image;
|
||||
use Carbon\Carbon;
|
||||
use Exception;
|
||||
@@ -338,6 +339,14 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the system language for this user.
|
||||
*/
|
||||
public function getLanguage(): string
|
||||
{
|
||||
return app()->make(LanguageManager::class)->getLanguageForUser($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the password reset notification.
|
||||
*
|
||||
|
Reference in New Issue
Block a user