588bcb08479f538b77e55715e35b9592b8733712
[GitHub/WoltLab/WCF.git] /
1 <?php
2
3 namespace wcf\system\user\notification\event;
4
5 use wcf\data\user\UserProfile;
6 use wcf\system\request\LinkHandler;
7 use wcf\system\user\notification\object\UserRegistrationUserNotificationObject;
8
9 /**
10 * Notification event for users that completed the registration process.
11 *
12 * @author Olaf Braun
13 * @copyright 2001-2024 WoltLab GmbH
14 * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
15 * @since 6.1
16 *
17 * @method UserRegistrationUserNotificationObject getUserNotificationObject()
18 */
19 class UserRegistrationSuccessUserNotificationEvent extends AbstractUserNotificationEvent implements
20 ITestableUserNotificationEvent
21 {
22 use TTestableUserNotificationEvent;
23
24 #[\Override]
25 public static function getTestObjects(UserProfile $recipient, UserProfile $author)
26 {
27 return [new UserRegistrationUserNotificationObject($author->getDecoratedObject())];
28 }
29
30 #[\Override]
31 public function getTitle(): string
32 {
33 return $this->getLanguage()->get('wcf.user.notification.registrationSuccess.title');
34 }
35
36 #[\Override]
37 public function getMessage()
38 {
39 return $this->getLanguage()->getDynamicVariable(
40 'wcf.user.notification.registrationSuccess.message',
41 [
42 'author' => $this->author,
43 'notification' => $this->notification,
44 'username' => $this->getUserNotificationObject()->username,
45 'userNotificationObject' => $this->getUserNotificationObject(),
46 ]
47 );
48 }
49
50 #[\Override]
51 public function getEmailMessage($notificationType = 'instant')
52 {
53 return [
54 'template' => 'email_notification_userRegistrationSuccess',
55 'application' => 'wcf',
56 'variables' => [
57 'notification' => $this->notification,
58 'username' => $this->getUserNotificationObject()->username,
59 'userNotificationObject' => $this->getUserNotificationObject(),
60 ],
61 ];
62 }
63
64 #[\Override]
65 public function getLink(): string
66 {
67 return LinkHandler::getInstance()->getLink('UserEdit', [
68 'object' => $this->getUserNotificationObject(),
69 'isACP' => true,
70 ]);
71 }
72
73 #[\Override]
74 public function getEventHash()
75 {
76 return \sha1($this->eventID);
77 }
78 }