Commit 8b666e5f authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

Problème de redirection

parent 8eb85cfe
Loading
Loading
Loading
Loading
Loading
+5 −3
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,6 +195,10 @@ class MailService {
        if ($this->doNotSend) {
            $sujet .= ' {REDIR}';
        }

        $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;