diff --git a/config/services.yaml b/config/services.yaml index 6d8da008..147de837 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -20,6 +20,7 @@ services: public: false bind: $allegroEndpoint: '%env(ALLEGRO_ENDPOINT)%' + $allegroOnbekendeSchuldeiser: '%env(ALLEGRO_ONBEKENDE_SCHULDEISER)%' GemeenteAmsterdam\FixxxSchuldhulp\: diff --git a/src/EventListener/MailNotitificationSubscriber.php b/src/EventListener/MailNotitificationSubscriber.php index 9123e7fb..a5840fce 100644 --- a/src/EventListener/MailNotitificationSubscriber.php +++ b/src/EventListener/MailNotitificationSubscriber.php @@ -202,6 +202,8 @@ protected function mail($from, $to, $template, $data) $message->setBody($html, 'text/html'); $message->addPart($txt, 'text/plain'); + $this->logger->info(sprintf('Mail from: %s, to: %s, subject: %s', $from, $to, $subject), ['mail']); + $this->mailer->send($message); } diff --git a/src/Service/AllegroService.php b/src/Service/AllegroService.php index fa3abe07..e9ba589f 100644 --- a/src/Service/AllegroService.php +++ b/src/Service/AllegroService.php @@ -47,8 +47,6 @@ class AllegroService 'Vrouw' => 'V', ]; - const ONBEKENDE_SCHULDEISER = '2450232'; - /** * Burgerlijke staat: * varchar(1), Null allowed, waarden(@, A = Onbekend, B = Alleenstaand, C = Samenwonend, D = Geregistreerd partnerschap, E = Gehuwd, F = Gescheiden, G = Weduwnaar, Null) @@ -104,6 +102,11 @@ class AllegroService */ private $security; + /** + * @var string + */ + private $onbekendeSchuldeiser; + public function __construct( string $allegroEndpoint, @@ -111,7 +114,8 @@ public function __construct( SchuldHulpService $altService, LoggerInterface $logger, EventDispatcherInterface $eventDispatcher, - Security $security + Security $security, + $allegroOnbekendeSchuldeiser ) { $this->loginWsdl = sprintf('%s?service=LoginService', $allegroEndpoint); $this->schuldHulpWsdl = sprintf('%s?service=SchuldHulpService', $allegroEndpoint); @@ -119,8 +123,8 @@ public function __construct( $this->logger = $logger; $this->eventDispatcher = $eventDispatcher; $this->security = $security; - $this->em = $em; + $this->onbekendeSchuldeiser = (string)$allegroOnbekendeSchuldeiser; } /** @@ -394,7 +398,7 @@ private function mapSchulden(Dossier $dossier): SchuldArray continue; } - $codeEiser = null === $item->getSchuldeiser()->getAllegroCode() ? self::ONBEKENDE_SCHULDEISER : $item->getSchuldeiser()->getAllegroCode(); + $codeEiser = null === $item->getSchuldeiser()->getAllegroCode() ? $this->onbekendeSchuldeiser : $item->getSchuldeiser()->getAllegroCode(); $schuld = new TSchuld($item->getSchuldeiser()->getBedrijfsnaam(), 1, $item->getBedrag(), $codeEiser);