You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

OpinionManager.php 872B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace common\logic\Opinion\Service;
  3. use common\logic\AbstractManager;
  4. use common\logic\User\User\Model\User;
  5. use common\logic\User\User\Service\UserSolver;
  6. class OpinionManager extends AbstractManager
  7. {
  8. protected UserSolver $userSolver;
  9. public function loadDependencies(): void
  10. {
  11. $this->userSolver = $this->loadService(UserSolver::class);
  12. }
  13. public function sendOpinionEmailAdmin($opinionFormModel, User $userCurrent = null)
  14. {
  15. \Yii::$app->mailerService->sendAdmin(
  16. 'Nouvel avis',
  17. 'newOpinionAdmin',
  18. [
  19. 'username' => $userCurrent ? $this->userSolver->getUsername($userCurrent) : $opinionFormModel->name,
  20. 'message' => $opinionFormModel->message,
  21. ],
  22. $userCurrent ? $userCurrent->email : $opinionFormModel->email
  23. );
  24. }
  25. }