From: x2000habouzit Date: Thu, 17 Nov 2005 08:15:11 +0000 (+0000) Subject: closes #376 X-Git-Tag: xorg/0.9.9~54 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=9898b36e1c9dc835b021c385ffa9765b9887cfa9;p=platal.git closes #376 git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@158 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/ChangeLog b/ChangeLog index f5a7658..95016dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -55,8 +55,9 @@ Bug/Wish : * Xnet : - #334: Interface improvements. -Car - #341: Improve member deletion. -MC + - #376: Reply-To on the mail form. -MC - * User Interface: + * User Interface : - #338: Broken FSF link fixed on donation page. -CAT - #339: New RSS links that allow direct and easier RSS activation. -CAT - #130: Each page now shows a different title. -CAT diff --git a/htdocs.net/groupe/mail.php b/htdocs.net/groupe/mail.php index 71ac706..f8c8c3d 100644 --- a/htdocs.net/groupe/mail.php +++ b/htdocs.net/groupe/mail.php @@ -15,7 +15,7 @@ require_once 'xnet/mail.inc.php'; $tos = get_all_redirects(Post::has('membres'), $mls, $client); - send_xnet_mails($from, $sujet, $body, $tos); + send_xnet_mails($from, $sujet, $body, $tos, Post::get('replyto')); $page->kill("Mail envoyé !"); $page->assign('sent', true); } diff --git a/include/xnet/mail.inc.php b/include/xnet/mail.inc.php index f1f05d6..c18a38d 100644 --- a/include/xnet/mail.inc.php +++ b/include/xnet/mail.inc.php @@ -74,7 +74,7 @@ function get_all_redirects($membres, $mls, &$client) // }}} // {{{ _send_xnet_mail -function _send_xnet_mail($user, $body, $mailer) +function _send_xnet_mail($user, $body, $mailer, $replyto = null) { $cher = isset($user['sexe']) ? ($user['sexe'] ? 'Chère' : 'Cher') : 'Cher(e)'; $nom = isset($user['nom']) ? $user['nom'] : ""; @@ -87,6 +87,9 @@ function _send_xnet_mail($user, $body, $mailer) $text = preg_replace('!!i', $pnom, $text); $mailer->addHeader('To', $to); + if ($replyto) { + $mailer->addHeader('Reply-To', $replyto); + } $mailer->setTxtBody(wordwrap($text, 72)); $mailer->send(); } @@ -94,7 +97,7 @@ function _send_xnet_mail($user, $body, $mailer) // }}} // {{{ send_xnet_mails -function send_xnet_mails($from, $sujet, $body, $tos) +function send_xnet_mails($from, $sujet, $body, $tos, $replyto = null) { $sent = array(); @@ -104,7 +107,7 @@ function send_xnet_mails($from, $sujet, $body, $tos) foreach ($tos as $user) { if ($sent[$user['email']]) continue; - _send_xnet_mail($user, $body, $mailer); + _send_xnet_mail($user, $body, $mailer, $replyto); $sent[$user['email']] = true; } } diff --git a/templates/xnet/groupe/mail.tpl b/templates/xnet/groupe/mail.tpl index d46f466..1023dce 100644 --- a/templates/xnet/groupe/mail.tpl +++ b/templates/xnet/groupe/mail.tpl @@ -41,6 +41,12 @@ masculin ou f value="{if $smarty.request.from}{$smarty.request.from}{else}"{$smarty.session.prenom} {$smarty.session.nom}" <{$smarty.session.bestalias}@polytechnique.org>{/if}" /> + + Reply-To : + + + + Destinataires