Skip to content
Snippets Groups Projects
Commit 6282e1e7 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Ajout de la notification vers le formateur dans la liste des configurations

parent beecf8da
No related branches found
No related tags found
No related merge requests found
......@@ -82,12 +82,17 @@ class NotificationService
public function generateAndSend(string $templateCode, $adresses, array $motsClefs = [], array $vars = []): ?Mail
{
try {
$rendu = $this->getRenduService()->generateRenduByTemplateCode($templateCode, $vars);
$mail = $this->getMailService()->sendMail($adresses, $rendu->getSujet(), $rendu->getCorps(), 'Formation');
$motsClefs[] = $rendu->getTemplate()->generateTag();
$mail->setMotsClefs($motsClefs);
$this->getMailService()->update($mail);
return $mail;
} catch (RuntimeException $e) {
$adresses = (is_array($adresses))?implode('|', $adresses):$adresses;
throw new RuntimeException("Un problème est survenu lors de l'envoi du mail vers [".$adresses."]",0,$e);
}
}
/** GESTION DES INSCRIPTIONS **************************************************************************************/
......@@ -294,7 +299,7 @@ class NotificationService
$vars = $this->generateVariableArray($inscrit);
$rendu = $this->getRenduService()->generateRenduByTemplateCode(MailTemplates::SESSION_DEMANDE_RETOUR, $vars);
if ($inscrit->getIndividu() !== null) {
if ($inscrit->getIndividu() !== null AND $inscrit->getIndividu()->getEmail() !== null) {
$mail = $this->getMailService()->sendMail($inscrit->getIndividu()->getEmail(), $rendu->getSujet(), $rendu->getCorps(), 'Formation');
$mail->setMotsClefs([$session->generateTag(), $inscrit->generateTag(), $rendu->getTemplate()->generateTag()]);
$this->getMailService()->update($mail);
......
......@@ -474,8 +474,11 @@ class SessionService
{
if ($instance->isEmargementActive()) {
$this->update($instance);
$configuration = $this->getNotificationConfigurationService()->getNotificationConfigurationWithParams("SESSION", MailTemplates::SESSION_EMARGEMENT, "Envoi de l'emargement");
if ($configuration === null OR $configuration->isActive()) {
$this->getNotificationService()->triggerLienPourEmargement($instance);
}
}
return $instance;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment