NotificatorInterface.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\User\Model\Spi;
  8. use Magento\User\Api\Data\UserInterface;
  9. /**
  10. * Use to send out notifications about user related events.
  11. */
  12. interface NotificatorInterface
  13. {
  14. /**
  15. * Send notification when a user requests password reset.
  16. *
  17. * @param UserInterface $user User that requested password reset.
  18. * @throws NotificationExceptionInterface
  19. *
  20. * @return void
  21. */
  22. public function sendForgotPassword(UserInterface $user): void;
  23. /**
  24. * Send a notification when a new user is created.
  25. *
  26. * @param UserInterface $user The new user.
  27. * @throws NotificationExceptionInterface
  28. *
  29. * @return void
  30. */
  31. public function sendCreated(UserInterface $user): void;
  32. /**
  33. * Send a notification when a user is updated.
  34. *
  35. * @param UserInterface $user The user updated.
  36. * @param string[] $changed List of changed properties.
  37. * @throws NotificationExceptionInterface
  38. *
  39. * @return void
  40. */
  41. public function sendUpdated(UserInterface $user, array $changed): void;
  42. }