-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…tion (#70) * IBX-7369: Added UserRegister notification * IBX-7371: Added UserPasswordReset notification * Registered Notifications Bundle in IbexaTestKernel
- Loading branch information
Showing
7 changed files
with
200 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/contracts/Notification/UserAwareNotificationInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Contracts\User\Notification; | ||
|
||
use Ibexa\Contracts\Core\Repository\Values\User\User; | ||
|
||
interface UserAwareNotificationInterface | ||
{ | ||
public function getUser(): User; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Contracts\User\Notification; | ||
|
||
use Ibexa\Contracts\Core\Repository\Values\User\User; | ||
use Symfony\Component\Notifier\Message\EmailMessage; | ||
use Symfony\Component\Notifier\Message\SmsMessage; | ||
use Symfony\Component\Notifier\Notification\EmailNotificationInterface; | ||
use Symfony\Component\Notifier\Notification\Notification; | ||
use Symfony\Component\Notifier\Notification\SmsNotificationInterface; | ||
use Symfony\Component\Notifier\Recipient\EmailRecipientInterface; | ||
use Symfony\Component\Notifier\Recipient\SmsRecipientInterface; | ||
|
||
final class UserPasswordReset | ||
extends Notification | ||
implements EmailNotificationInterface, SmsNotificationInterface, UserAwareNotificationInterface | ||
{ | ||
private User $user; | ||
|
||
private string $token; | ||
|
||
public function __construct( | ||
User $user, | ||
string $token | ||
) { | ||
parent::__construct(); | ||
|
||
$this->user = $user; | ||
$this->token = $token; | ||
} | ||
|
||
public function asEmailMessage(EmailRecipientInterface $recipient, string $transport = null): ?EmailMessage | ||
{ | ||
return null; | ||
} | ||
|
||
public function asSmsMessage(SmsRecipientInterface $recipient, string $transport = null): ?SmsMessage | ||
{ | ||
return null; | ||
} | ||
|
||
public function getUser(): User | ||
{ | ||
return $this->user; | ||
} | ||
|
||
public function getToken(): string | ||
{ | ||
return $this->token; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
/** | ||
* @copyright Copyright (C) Ibexa AS. All rights reserved. | ||
* @license For full copyright and license information view LICENSE file distributed with this source code. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Ibexa\Contracts\User\Notification; | ||
|
||
use Ibexa\Contracts\Core\Repository\Values\User\User; | ||
use Symfony\Component\Notifier\Message\EmailMessage; | ||
use Symfony\Component\Notifier\Message\SmsMessage; | ||
use Symfony\Component\Notifier\Notification\EmailNotificationInterface; | ||
use Symfony\Component\Notifier\Notification\Notification; | ||
use Symfony\Component\Notifier\Notification\SmsNotificationInterface; | ||
use Symfony\Component\Notifier\Recipient\EmailRecipientInterface; | ||
use Symfony\Component\Notifier\Recipient\SmsRecipientInterface; | ||
|
||
final class UserRegister | ||
extends Notification | ||
implements EmailNotificationInterface, SmsNotificationInterface, UserAwareNotificationInterface | ||
{ | ||
private User $user; | ||
|
||
public function __construct(User $user) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->user = $user; | ||
} | ||
|
||
public function asEmailMessage(EmailRecipientInterface $recipient, string $transport = null): ?EmailMessage | ||
{ | ||
return null; | ||
} | ||
|
||
public function asSmsMessage(SmsRecipientInterface $recipient, string $transport = null): ?SmsMessage | ||
{ | ||
return null; | ||
} | ||
|
||
public function getUser(): User | ||
{ | ||
return $this->user; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters