Total Complexity | 4 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
22 | final class WelcomeEmailFactory extends AbstractUserEmailFactory |
||
23 | { |
||
24 | public const MESSAGE_ID_PREFIX = 'wef'; |
||
25 | |||
26 | public function create(AbstractUser $user, array $context = []): ?RawMessage |
||
27 | { |
||
28 | if (!$this->enabled) { |
||
29 | return null; |
||
30 | } |
||
31 | |||
32 | $this->initUser($user); |
||
33 | |||
34 | $token = $user->plainEmailAddressVerifyToken; |
||
35 | $user->plainEmailAddressVerifyToken = null; |
||
36 | if ($token) { |
||
37 | $context['redirect_url'] = $this->getTokenUrl($token, $user->getUsername()); |
||
|
|||
38 | } |
||
39 | |||
40 | return $this->createEmailMessage($context); |
||
41 | } |
||
42 | |||
43 | protected function getTemplate(): string |
||
46 | } |
||
47 | } |
||
48 |