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

Problème de redirection

parent 8eb85cfe
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment