3 namespace wcf\system\user\notification\event;
5 use wcf\data\user\UserProfile;
6 use wcf\system\user\notification\object\UserFollowUserNotificationObject;
7 use wcf\system\user\notification\object\UserRegistrationUserNotificationObject;
10 * Notification event for new user registrations.
13 * @copyright 2001-2020 WoltLab GmbH
14 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
15 * @package WoltLabSuite\Core\System\User\Notification\Event
18 * @method UserRegistrationUserNotificationObject getUserNotificationObject()
20 class UserRegistrationUserNotificationEvent extends AbstractUserNotificationEvent implements
21 ITestableUserNotificationEvent
23 use TTestableUserNotificationEvent;
28 protected $stackable = true;
33 public function getTitle()
35 $count = \count($this->getAuthors());
37 return $this->getLanguage()->getDynamicVariable(
38 'wcf.user.notification.userRegistration.title.stacked',
43 return $this->getLanguage()->get('wcf.user.notification.userRegistration.title');
49 public function getMessage()
51 $authors = \array_values($this->getAuthors());
52 $count = \count($authors);
55 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.userRegistration.message.stacked', [
56 'author' => $this->author,
57 'authors' => $authors,
59 'others' => $count - 1,
63 return $this->getLanguage()->getDynamicVariable(
64 'wcf.user.notification.userRegistration.message',
65 ['author' => $this->author]
72 public function getEmailMessage($notificationType = 'instant')
75 'template' => 'email_notification_userRegistration',
76 'application' => 'wcf',
83 public function getLink()
85 return $this->author->getLink();
91 public function getEventHash()
93 return \sha1($this->eventID);
98 * @return UserFollowUserNotificationObject[]
100 public static function getTestObjects(UserProfile $recipient, UserProfile $author)
102 return [new UserRegistrationUserNotificationObject($author->getDecoratedObject())];