summaryrefslogtreecommitdiffstats
path: root/core/Notification
diff options
context:
space:
mode:
authorszaimen <szaimen@e.mail.de>2022-10-20 17:45:46 +0200
committerszaimen <szaimen@e.mail.de>2022-10-24 18:28:00 +0200
commit9e7e1e8a872e34e9f515c184d0fbfeed956730ae (patch)
treec6e4efd1ea795695132204958081b1bef19e2191 /core/Notification
parent6435191a6e96600db9efbad8514d6c2eff1375d1 (diff)
downloadnextcloud-server-9e7e1e8a872e34e9f515c184d0fbfeed956730ae.tar.gz
nextcloud-server-9e7e1e8a872e34e9f515c184d0fbfeed956730ae.zip
update notifications for one-click instances
Signed-off-by: szaimen <szaimen@e.mail.de>
Diffstat (limited to 'core/Notification')
-rw-r--r--core/Notification/CoreNotifier.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/core/Notification/CoreNotifier.php b/core/Notification/CoreNotifier.php
index 6d2a07337a6..6665389dbac 100644
--- a/core/Notification/CoreNotifier.php
+++ b/core/Notification/CoreNotifier.php
@@ -28,18 +28,23 @@ declare(strict_types=1);
*/
namespace OC\Core\Notification;
+use OCP\IConfig;
use OCP\IURLGenerator;
use OCP\L10N\IFactory;
+use OCP\Notification\IAction;
use OCP\Notification\INotification;
use OCP\Notification\INotifier;
class CoreNotifier implements INotifier {
+ /** @var IConfig */
+ private $config;
/** @var IFactory */
private $l10nFactory;
/** @var IURLGenerator */
private $url;
- public function __construct(IFactory $factory, IURLGenerator $url) {
+ public function __construct(IConfig $config, IFactory $factory, IURLGenerator $url) {
+ $this->config = $config;
$this->l10nFactory = $factory;
$this->url = $url;
}
@@ -79,9 +84,16 @@ class CoreNotifier implements INotifier {
if ($notification->getSubject() === 'user_limit_reached') {
$notification->setParsedSubject($l->t('The user limit of this instance is reached.'));
- $notification->setParsedMessage($l->t('Enter your subscription key to increase the user limit. For more information about Nextcloud Enterprise see our website.'));
- $notification->setLink('https://nextcloud.com/enterprise/');
+ $notification->setParsedMessage($l->t('Enter your subscription key in the support app in order to increase the user limit. This does also grant you all additional benefits that Nextcloud Enterprise offers and is highly recommended for the operation in companies.'));
$notification->setIcon($this->url->getAbsoluteURL($this->url->imagePath('core', 'places/contacts.svg')));
+ $action = $notification->createAction();
+ $label = $l->t('Learn more ↗');
+ $link = $this->config->getSystemValueString('one-click-instance.link', 'https://nextcloud.com/enterprise/');
+ $action->setLabel($label)
+ ->setParsedLabel($label)
+ ->setLink($link, IAction::TYPE_WEB)
+ ->setPrimary(true);
+ $notification->addParsedAction($action);
return $notification;
}