No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

36 líneas
970B

  1. <?php
  2. namespace domain\Communication\AutomaticEmail;
  3. use domain\_\AbstractManager;
  4. use domain\Producer\Producer\Producer;
  5. class AutomaticEmailManager extends AbstractManager
  6. {
  7. protected AutomaticEmailBuilder $automaticEmailBuilder;
  8. public function loadDependencies(): void
  9. {
  10. $this->automaticEmailBuilder = $this->loadService(AutomaticEmailBuilder::class);
  11. }
  12. public function createAutomaticEmail(
  13. Producer $producer,
  14. int $day,
  15. string $subject,
  16. string $message,
  17. bool $integrateProductList = null
  18. ): AutomaticEmail
  19. {
  20. $automaticEmail = $this->automaticEmailBuilder->instanciateAutomaticEmail($producer);
  21. $automaticEmail->setDay($day);
  22. $automaticEmail->setSubject($subject);
  23. $automaticEmail->setMessage($message);
  24. $automaticEmail->setIntegrateProductList($integrateProductList);
  25. $automaticEmail->save();
  26. return $automaticEmail;
  27. }
  28. }