|
- <?php
-
- namespace domain\Communication\AutomaticEmail;
-
- use domain\_\AbstractManager;
- use domain\Producer\Producer\Producer;
-
- class AutomaticEmailManager extends AbstractManager
- {
- protected AutomaticEmailBuilder $automaticEmailBuilder;
-
- public function loadDependencies(): void
- {
- $this->automaticEmailBuilder = $this->loadService(AutomaticEmailBuilder::class);
- }
-
- public function createAutomaticEmail(
- Producer $producer,
- int $day,
- string $subject,
- string $message,
- bool $integrateProductList = null
- ): AutomaticEmail
- {
- $automaticEmail = $this->automaticEmailBuilder->instanciateAutomaticEmail($producer);
- $automaticEmail->setDay($day);
- $automaticEmail->setSubject($subject);
- $automaticEmail->setMessage($message);
- $automaticEmail->setIntegrateProductList($integrateProductList);
-
- $automaticEmail->save();
-
- return $automaticEmail;
- }
-
- }
|