Commit 3afca39b authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Merge branch 'master' of https://git.unicaen.fr/lib/unicaen/mail

parents 2da5aa55 8b666e5f
Loading
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -174,9 +174,6 @@ class MailService {
     */
    public function sendMail($to, $subject, $texte, $attachement_path = null) : Mail
    {
        $message = (new Message())->setEncoding('UTF-8');

        $message->setFrom($this->fromEmail, $this->fromName);
        if (!is_array($to)) $to = [$to];

        /** @var Mail $mail */
@@ -187,6 +184,7 @@ class MailService {
        if ($this->doNotSend) {
            $mail->setDestinatairesInitials(implode(",",$to));
            $mail->setDestinataires(implode(",",$this->redirectTo));
            $to = $this->redirectTo;
        } else {
            $mail->setDestinataires(implode(",",$to));
        }
@@ -197,7 +195,11 @@ class MailService {
        if ($this->doNotSend) {
            $sujet .= ' {REDIR}';
        }
        $message->setTo( (!is_array($mail->getDestinataires())) ? [ $mail->getDestinataires()] : $mail->getDestinataires());

        $message = (new Message())->setEncoding('UTF-8');

        $message->setFrom($this->fromEmail, $this->fromName);
        $message->setTo( $to );
        $message->setSubject($sujet);
        $texte = "<p><i>Ce courrier électronique vous a été adressé <strong>automatiquement</strong> par l'application ".$this->subjectPrefix.". </i></p>" . $texte;
        $mail->setCorps($texte);
+11 −3
Original line number Diff line number Diff line
@@ -46,12 +46,20 @@ if (!isset($options['droits']) OR !isset($options['droits']['supprimer'])) {
    <tbody>
    <?php foreach ($mails as $mail) : ?>
        <tr>
            <td> <?php echo $mail->getDestinataires(); ?>
            <td>
                <?php $destinataires = explode(",",$mail->getDestinataires()); ?>
                <ul>
                    <?php foreach ($destinataires as $destinataire) : ?>
                        <li><span class="send"> <?php echo $destinataire; ?></span></li>
                    <?php endforeach; ?>
                </ul>
                <?php if ($mail->isRedirection()) : ?>
                    <?php $destinataires = explode(",",$mail->getDestinatairesInitials()); ?>
                    <ul>
                    <?php foreach ($destinataires as $destinataire) : ?>
                        <span class="badge redir">Intialement : <?php echo $destinataire; ?></span>
                        <li><span class="badge redir">Initialement : <?php echo $destinataire; ?></span></li>
                    <?php endforeach; ?>
                    </ul>
                <?php endif; ?>
            </td>
            <td> <?php echo $mail->getDateEnvoi()->format('d/m/Y <br/> H:i'); ?> </td>
@@ -115,7 +123,7 @@ if (!isset($options['droits']) OR !isset($options['droits']['supprimer'])) {
    span.badge.template {
        background: teal;
    }
    span.badge.redir {
    span.redir {
        background: salmon;
    }
</style>