backport the reply-to thing
authorx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 17 Nov 2005 08:19:27 +0000 (08:19 +0000)
committerx2000habouzit <x2000habouzit@839d8a87-29fc-0310-9880-83ba4fa771e5>
Thu, 17 Nov 2005 08:19:27 +0000 (08:19 +0000)
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
include/xnet/mail.inc.php
templates/xnet/groupe/mail.tpl

index f81937a..4eb2c07 100644 (file)
@@ -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);
     }
index ad5f4d2..80baf6e 100644 (file)
@@ -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('!<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 fcc6a4b..54913b5 100644 (file)
@@ -41,17 +41,23 @@ 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>
     </tr>
     <tr valign="top">
       <td style='padding-left: 1em' class='titre'>
-        *&nbsp;<em>membres</em>
+        *&nbsp;<em>annuaire</em>
       </td>
       <td>
         <input type="checkbox" name="membres" value="1" {if $smarty.request.membres}checked="checked"{/if} />
-        <em>écrit à tous les membres du groupe</em> <a href="annuaire.php" class='popup'>(voir membres)</a>
+        <em>écrit à tout l'annuaire du groupe</em> <a href="annuaire.php" class='popup'>(voir annuaire)</a>
       </td>
     </tr>