closes #376
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 17 Nov 2005 08:15:11 +0000 (08:15 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 17 Nov 2005 08:15:11 +0000 (08:15 +0000)
git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@158 839d8a87-29fc-0310-9880-83ba4fa771e5

ChangeLog
htdocs.net/groupe/mail.php
include/xnet/mail.inc.php
templates/xnet/groupe/mail.tpl

index f5a7658..95016dd 100644 (file)
--- 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
index 71ac706..f8c8c3d 100644 (file)
@@ -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);
     }
index f1f05d6..c18a38d 100644 (file)
@@ -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('!<prenom>!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;
     }
 }
index d46f466..1023dce 100644 (file)
@@ -41,6 +41,12 @@ masculin ou f
           value="{if $smarty.request.from}{$smarty.request.from}{else}&quot;{$smarty.session.prenom} {$smarty.session.nom}&quot; <{$smarty.session.bestalias}@polytechnique.org>{/if}" />
       </td>
     </tr>
+    <tr>
+      <td class="titre">Reply-To :</td>
+      <td>
+        <input type="text" name="replyto" size="55" maxlength="70" value="{$smarty.request.replyto}" />
+      </td>
+    </tr>
 
     <tr>
       <th colspan="2">Destinataires</th>