Loading src/UnicaenMail/Service/Mail/MailService.php +6 −4 Original line number Diff line number Diff line Loading @@ -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 */ Loading @@ -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)); } Loading @@ -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); Loading src/UnicaenMail/View/Helper/partial/mails.phtml +11 −3 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -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> Loading
src/UnicaenMail/Service/Mail/MailService.php +6 −4 Original line number Diff line number Diff line Loading @@ -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 */ Loading @@ -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)); } Loading @@ -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); Loading
src/UnicaenMail/View/Helper/partial/mails.phtml +11 −3 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -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>