3 namespace wcf\system\user\notification\event;
5 use wcf\data\user\UserProfile;
6 use wcf\system\request\LinkHandler;
7 use wcf\system\user\notification\object\UserRegistrationUserNotificationObject;
10 * Notification event for users that need activation by an admin.
13 * @copyright 2001-2024 WoltLab GmbH
14 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
17 * @method UserRegistrationUserNotificationObject getUserNotificationObject()
19 class UserNeedActivationUserNotificationEvent extends AbstractUserNotificationEvent implements
20 ITestableUserNotificationEvent
22 use TTestableUserNotificationEvent;
25 public static function getTestObjects(UserProfile $recipient, UserProfile $author)
27 return [new UserRegistrationUserNotificationObject($author->getDecoratedObject())];
31 public function getTitle(): string
33 return $this->getLanguage()->get('wcf.user.notification.userNeedActivation.title');
37 public function getMessage()
39 return $this->getLanguage()->getDynamicVariable(
40 'wcf.user.notification.userNeedActivation.message',
42 'author' => $this->author,
43 'notification' => $this->notification,
44 'username' => $this->getUserNotificationObject()->username,
45 'userNotificationObject' => $this->getUserNotificationObject(),
51 public function getEmailMessage($notificationType = 'instant')
54 'template' => 'email_notification_userNeedActivation',
55 'application' => 'wcf',
57 'notification' => $this->notification,
58 'username' => $this->getUserNotificationObject()->username,
59 'userNotificationObject' => $this->getUserNotificationObject(),
65 public function getLink(): string
67 return LinkHandler::getInstance()->getLink('UserEdit', [
68 'object' => $this->getUserNotificationObject(),
74 public function getEventHash()
76 return \sha1($this->eventID);