您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

30 行
828B

  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. }