From 95c9ce9f0e2d954411c2ec2193358c5312084bf0 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Thu, 17 Nov 2005 08:19:27 +0000 Subject: [PATCH] backport the reply-to thing git-svn-id: svn+ssh://murphy/home/svn/platal/branches/platal-0.9.8@159 839d8a87-29fc-0310-9880-83ba4fa771e5 --- htdocs.net/groupe/mail.php | 2 +- include/xnet/mail.inc.php | 9 ++++++--- templates/xnet/groupe/mail.tpl | 10 ++++++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/htdocs.net/groupe/mail.php b/htdocs.net/groupe/mail.php index f81937a..4eb2c07 100644 --- a/htdocs.net/groupe/mail.php +++ b/htdocs.net/groupe/mail.php @@ -19,7 +19,7 @@ require_once 'xnet/mail.inc.php'; $tos = get_all_redirects(Post::has('membres'), $mls, $als, $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 ad5f4d2..80baf6e 100644 --- a/include/xnet/mail.inc.php +++ b/include/xnet/mail.inc.php @@ -74,7 +74,7 @@ function get_all_redirects($membres, $mls, $alias, &$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 fcc6a4b..54913b5 100644 --- a/templates/xnet/groupe/mail.tpl +++ b/templates/xnet/groupe/mail.tpl @@ -41,17 +41,23 @@ 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 - * membres + * annuaire - écrit à tous les membres du groupe (voir membres) + écrit à tout l'annuaire du groupe (voir annuaire) -- 2.1.4