diff --git a/module/CudiBundle/Command/CatalogUpdate.php b/module/CudiBundle/Command/CatalogUpdate.php index 1e6e3ddb2e..26c18fb202 100644 --- a/module/CudiBundle/Command/CatalogUpdate.php +++ b/module/CudiBundle/Command/CatalogUpdate.php @@ -253,13 +253,17 @@ private function notifySubscribers(array $subjects, AcademicYear $academicYear) ->setFrom($mailAddress, $mailName) ->addTo($subscription->getPerson()->getEmail(), $subscription->getPerson()->getFullName()) ->addCc($mailAddress, $mailName) - ->addBcc( + ->setSubject($mailSubject); + + if($this->getEntityManager()->getRepository('Common\Entity\General\Config') + ->getConfigValue('cudi.catalog_update_mail_to_sysadmin')){ + $mail->addBcc( $this->getEntityManager() ->getRepository('CommonBundle\Entity\General\Config') ->getConfigValue('system_administrator_mail'), 'System Administrator' - ) - ->setSubject($mailSubject); + ); + } if ($sendMails) { $this->getMailTransport() diff --git a/module/CudiBundle/Resources/config/install/configuration.config.php b/module/CudiBundle/Resources/config/install/configuration.config.php index 1396723ad8..d14b3b00d5 100644 --- a/module/CudiBundle/Resources/config/install/configuration.config.php +++ b/module/CudiBundle/Resources/config/install/configuration.config.php @@ -403,6 +403,11 @@ 'value' => '1', 'description' => 'Flag whether to send the catalog update mails.', ), + array( + 'key' => 'cudi.catalog_update_mail_to_sysadmin', + 'value' => '1', + 'description' => 'Flag whether to send the catalog update mails tot sysadmin.', + ), array( 'key' => 'cudi.sale_light_version', 'value' => '0',