X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fxnetgrp%2Fmail.inc.php;h=eadeb167a0eb80c4cc27e02333d67cd8ccb4fe4f;hb=3422f7193e38e67054d2ecda2f4a68b64bd310ef;hp=090b5b5964087076acf9fbde4dda839fa8e235c3;hpb=5660032ac785d410f90e3f5b0d6948dc90b0cfea;p=platal.git diff --git a/modules/xnetgrp/mail.inc.php b/modules/xnetgrp/mail.inc.php index 090b5b5..eadeb16 100644 --- a/modules/xnetgrp/mail.inc.php +++ b/modules/xnetgrp/mail.inc.php @@ -1,6 +1,6 @@ isFemale() ? 'Chère' : 'Cher'; - $nom = $user->displayName(); - $pnom = ''; + $dear = $user->isFemale() ? 'Chère' : 'Cher'; + $lastname = $user->lastName(); + $firstname = $user->firstName(); } else { - $cher = 'Cher(e)'; - $nom = $user; - $pnom = ''; + $dear = 'Cher(e)'; + $lastname = ''; + $firstname = $user; } $text = str_ireplace(array('', '', ''), - array($cher, $nom, $pnom), $body); - $mailer->addTo($user); + array($dear, $lastname, $firstname), $body); + $mailer->setTo($user); if ($replyto) { $mailer->addHeader('Reply-To', $replyto); } @@ -100,11 +100,11 @@ function send_xnet_mails($from, $sujet, $body, $wiki, $tos, $replyto = null, $up } else { $email = $user; } - if ($sent[$email]) { - continue; + + if (!isset($sent[$email])) { + _send_xnet_mail($user, $body, $wiki, $mailer, $replyto); + $sent[$email] = true; } - _send_xnet_mail($user, $body, $wiki, $mailer, $replyto); - $sent[$email] = true; } }