Commit f166b23e authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Notif Doctorant admis: envoi au BDD si le doctorant n'a pas de mail.

parent a450f678
Loading
Loading
Loading
Loading
+10 −0
Changes for module/Application/src/Application/Notification/ResultatTheseAdmisNotification.php: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -17,12 +17,22 @@ class ResultatTheseAdmisNotification extends Notification
    public function prepare()
    {
        $to = $this->these->getDoctorant()->getEmailPro() ?: $this->these->getDoctorant()->getEmail();

        $emailDoctorantAbsent = false;
        if (! $to) {
            // lorsque le doctorant n'a pas d'email, envoi au BDD (+ petit message d'alerte dans le mail)
            $emailDoctorantAbsent = true;
            $to = $this->emailBdd;
        }

        $this->setTo($to);
        $this->setSubject("Votre dossier est complet");

        $this->setTemplateVariables([
            'these' => $this->these,
            'contact' => $this->emailBdd,
            'doctorant' => $this->these->getDoctorant(),
            'emailDoctorantAbsent' => $emailDoctorantAbsent,
        ]);

        return $this;
+9 −1
Changes for module/Application/view/application/import/mail/notif-resultat-admis-doctorant.phtml: 9 added lines, 1 removed line.
Original line number Diff line number Diff line
<?php

use Application\Entity\Db\Doctorant;
use Application\Entity\Db\These;
use Application\View\Renderer\PhpRenderer;

/**
 * @var PhpRenderer $this
 * @var These $these
 * @var bool  $updating
 * @var string $contact
 * @var Doctorant $doctorant
 * @var bool  $emailDoctorantAbsent
 */
?>

@@ -17,6 +19,12 @@ use Application\View\Renderer\PhpRenderer;
<p>
    Ceci est un mail envoyé automatiquement par l'application <?php echo $this->appInfos()->nom ?>.
</p>
<?php if ($emailDoctorantAbsent): ?>
<p>
    <em>Ce mail aurait dû être envoyé à <?php echo $doctorant ?> (<?php echo $doctorant->getSourceCodeSansPrefix() ?>)
    mail aucune adresse mail n'a été trouvée pour ce doctorant.</em>
</p>
<?php endif ?>
<p>
    Votre dossier est complet.
</p>