Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

OpinionManager.php 828B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace domain\Opinion;
  3. use domain\User\User\User;
  4. use domain\User\User\UserSolver;
  5. use domain\_\AbstractManager;
  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. }