2 namespace wcf\system\user\notification\event;
3 use wcf\data\user\UserProfile;
4 use wcf\system\request\LinkHandler;
5 use wcf\system\user\notification\object\UserFollowUserNotificationObject;
6 use wcf\system\user\notification\object\UserRegistrationUserNotificationObject;
9 * Notification event for new user registrations.
12 * @copyright 2001-2019 WoltLab GmbH
13 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
14 * @package WoltLabSuite\Core\System\User\Notification\Event
17 * @method UserRegistrationUserNotificationObject getUserNotificationObject()
19 class UserRegistrationUserNotificationEvent extends AbstractUserNotificationEvent implements ITestableUserNotificationEvent {
20 use TTestableUserNotificationEvent;
25 protected $stackable = true;
30 public function getTitle() {
31 $count = count($this->getAuthors());
33 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.userRegistration.title.stacked', ['count' => $count]);
36 return $this->getLanguage()->get('wcf.user.notification.userRegistration.title');
42 public function getMessage() {
43 $authors = array_values($this->getAuthors());
44 $count = count($authors);
47 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.userRegistration.message.stacked', [
48 'author' => $this->author,
49 'authors' => $authors,
51 'others' => $count - 1
55 return $this->getLanguage()->getDynamicVariable('wcf.user.notification.userRegistration.message', ['author' => $this->author]);
61 public function getEmailMessage($notificationType = 'instant') {
63 'template' => 'email_notification_userRegistration',
64 'application' => 'wcf'
71 public function getLink() {
72 return LinkHandler::getInstance()->getLink('User', ['object' => $this->author]);
78 public function getEventHash() {
79 return sha1($this->eventID);
84 * @return UserFollowUserNotificationObject[]
86 public static function getTestObjects(UserProfile $recipient, UserProfile $author) {
87 return [new UserRegistrationUserNotificationObject($author)];