Forráskód Böngészése

move mail address to services.yaml

Olivier Massot 1 éve
szülő
commit
78bf36e7e0

+ 1 - 0
config/services.yaml

@@ -23,6 +23,7 @@ services:
             $opentalentNoReplyEmailAddress: 'noreply@opentalent.fr'
             $legacyBaseUrl: '%env(PUBLIC_API_LEG_BASE_URL)%'
             $baseUrl: '%env(PUBLIC_API_BASE_URL)%'
+            $opentalentMailReport: 'mail.report@opentalent.fr'
 
     # makes classes in src/ available to be used as services
     # this creates a service per class whose id is the fully-qualified class name

+ 4 - 3
src/Message/Handler/OrganizationDeletionHandler.php

@@ -20,6 +20,7 @@ class OrganizationDeletionHandler
     public function __construct(
         private readonly OrganizationFactory $organizationFactory,
         private readonly MailerInterface $symfonyMailer,
+        private readonly string $opentalentMailReport
     ) {}
 
     /**
@@ -46,9 +47,9 @@ class OrganizationDeletionHandler
         } finally {
             if ($organizationCreationRequest->getSendConfirmationEmailAt() !== null) {
                 $symfonyMail = (new SymfonyEmail())
-                    ->from('mail.report@opentalent.fr')
-                    ->replyTo('mail.report@opentalent.fr')
-                    ->returnPath(Address::create('mail.report@opentalent.fr'))
+                    ->from($this->opentalentMailReport)
+                    ->replyTo($this->opentalentMailReport)
+                    ->returnPath(Address::create($this->opentalentMailReport))
                     ->to($organizationCreationRequest->getSendConfirmationEmailAt())
                     ->subject($mail['subject'])
                     ->text($mail['content']);