diff options
author | Joas Schilling <coding@schilljs.com> | 2021-09-29 17:23:33 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-10-11 17:03:32 +0300 |
commit | 0eeb451cdb728cbc34ba9d82aa16211dd7c684b9 (patch) | |
tree | 04d021aa23d08b0f9f7a2d51342b8f2addc171f8 /lib | |
parent | 066a1eb1a1d62ac778b031ec5d2f8dbfeb373d38 (diff) |
Improve email wording for screenreaders
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/MailNotifications.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/MailNotifications.php b/lib/MailNotifications.php index bb0ff91..03ec5db 100644 --- a/lib/MailNotifications.php +++ b/lib/MailNotifications.php @@ -29,6 +29,7 @@ use OCP\Defaults; use OCP\IConfig; use OCP\IDateTimeFormatter; use OCP\IURLGenerator; +use OCP\IUser; use OCP\IUserManager; use OCP\L10N\IFactory; use OCP\Mail\IMailer; @@ -192,6 +193,10 @@ class MailNotifications { */ protected function prepareEmailMessage(string $uid, array $notifications, string $language): ?IMessage { $user = $this->userManager->get($uid); + if (!$user instanceof IUser) { + return null; + } + $userEmailAddress = $user->getEMailAddress(); if (empty($userEmailAddress)) { @@ -240,8 +245,8 @@ class MailNotifications { // Prepare email footer $template->addBodyText( - $l10n->t('You can change the frequency of these emails or disable them <a href="%s">here</a>.', $this->urlGenerator->linkToRouteAbsolute('settings.PersonalSettings.index', ['section' => 'notifications'])), - $l10n->t('You can change the frequency of these emails or disable them here: %s', $this->urlGenerator->linkToRouteAbsolute('settings.PersonalSettings.index', ['section' => 'notifications'])) + $l10n->t('You can change the frequency of these emails or disable them in the <a href="%s">settings</a>.', $this->urlGenerator->linkToRouteAbsolute('settings.PersonalSettings.index', ['section' => 'notifications'])), + $l10n->t('You can change the frequency of these emails or disable them in the settings: %s', $this->urlGenerator->linkToRouteAbsolute('settings.PersonalSettings.index', ['section' => 'notifications'])) ); $template->addFooter(); |