X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fxnetgrp%2Fmail.inc.php;h=a998e99ae6324688e46a246c1ac6c5ce10f863d1;hb=74f583b3308a61b2cdb5fa789595f322d8e190df;hp=3d554132b00818bd4b8f566a7ab6ba23d11adc95;hpb=06db561e25dcd609e824d1461fd2814d1e46d807;p=platal.git diff --git a/modules/xnetgrp/mail.inc.php b/modules/xnetgrp/mail.inc.php index 3d55413..a998e99 100644 --- a/modules/xnetgrp/mail.inc.php +++ b/modules/xnetgrp/mail.inc.php @@ -1,6 +1,6 @@ " : $user['email']; - + $text = $body; $text = preg_replace('!!i', $cher, $text); $text = preg_replace('!!i', $nom, $text); @@ -92,14 +92,18 @@ function _send_xnet_mail($user, $body, $mailer, $replyto = null) if ($replyto) { $mailer->addHeader('Reply-To', $replyto); } - $mailer->setTxtBody(wordwrap($text, 72)); -// $mailer->send(); + if ($wiki) { + $mailer->setWikiBody($text); + } else { + $mailer->setTxtBody(wordwrap($text, 72)); + } + $mailer->send(); } // }}} // {{{ send_xnet_mails -function send_xnet_mails($from, $sujet, $body, $tos, $replyto = null) +function send_xnet_mails($from, $sujet, $body, $wiki, $tos, $replyto = null, $upload = null, $name = null) { global $globals; $sent = array(); @@ -107,15 +111,18 @@ function send_xnet_mails($from, $sujet, $body, $tos, $replyto = null) $mailer = new PlMailer(); $mailer->setSubject($sujet); $mailer->setFrom($from); + if ($upload && $upload->exists()) { + $mailer->addUploadAttachment($upload, $name); + } foreach ($tos as $user) { if ($sent[$user['email']]) continue; - _send_xnet_mail($user, $body, $mailer, $replyto); + _send_xnet_mail($user, $body, $wiki, $mailer, $replyto); $sent[$user['email']] = true; } } // }}} -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: ?>