diff --git a/lib/Listener/LoginMailListener.php b/lib/Listener/LoginMailListener.php index 3b856f84..308b9a90 100644 --- a/lib/Listener/LoginMailListener.php +++ b/lib/Listener/LoginMailListener.php @@ -89,7 +89,8 @@ private function getMail(SuspiciousLoginEvent $event, IUser $user): IMessage { $additionalText = ''; // Add explanation for more information about the IP-address (if enabled) if ($addButton) { - $additionalText = ' ' . $this->l->t('You can get more info by pressing the button which will open %s and show info about the suspicious IP-address.', 'https://iplookup.flagfox.net'); + // TODO: deduplicate with \OCA\SuspiciousLogin\Notifications\Notifier::prepare + $additionalText = ' ' . $this->l->t('More info about the suspicious IP address available on %s', 'https://iplookup.flagfox.net'); } $emailTemplate->addBodyText( $this->l->t('A new login into your account was detected. The IP address %s was classified as suspicious. If this was you, you can ignore this message. Otherwise you should change your password.', $suspiciousIp) . $additionalText @@ -98,7 +99,7 @@ private function getMail(SuspiciousLoginEvent $event, IUser $user): IMessage { if ($addButton) { $link = 'https://iplookup.flagfox.net/?ip=' . $suspiciousIp; $emailTemplate->addBodyButton( - htmlspecialchars($this->l->t('More information ↗')), + htmlspecialchars($this->l->t('Open %s ↗', ['iplookup.flagfox.net'])), $link, false ); diff --git a/lib/Notifications/Notifier.php b/lib/Notifications/Notifier.php index e3ac4626..fbd79907 100644 --- a/lib/Notifications/Notifier.php +++ b/lib/Notifications/Notifier.php @@ -72,14 +72,15 @@ public function prepare(INotification $notification, string $languageCode): INot // Add button for more information about the IP-address if ($this->config->getAppValue('suspicious_login', 'show_more_info_button', '1') === "1") { $action = $notification->createAction(); - $label = $l->t('More information ↗'); + $label = $l->t('Open %s ↗', ['iplookup.flagfox.net']); $link = 'https://iplookup.flagfox.net/?ip=' . $suspiciousIp; $action->setLabel($label) ->setParsedLabel($label) ->setLink($link, IAction::TYPE_WEB) ->setPrimary(true); $notification->addParsedAction($action); - $additionalText = ' ' . $l->t('You can get more info by pressing the button which will open %s and show info about the suspicious IP-address.', 'https://iplookup.flagfox.net'); + // TODO: deduplicate with \OCA\SuspiciousLogin\Listener\LoginMailListener::getMail + $additionalText = ' ' . $l->t('More info about the suspicious IP address available on %s', 'https://iplookup.flagfox.net'); } $notification->setParsedSubject(