groups: Add footer to xnet-sent emails.
authorRaphaël Barrois <raphael.barrois@polytechnique.org>
Tue, 23 Apr 2013 22:54:16 +0000 (00:54 +0200)
committerRaphaël Barrois <raphael.barrois@polytechnique.org>
Tue, 23 Apr 2013 22:54:16 +0000 (00:54 +0200)
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
ChangeLog
modules/xnetgrp/mail.inc.php

index cc7b5b7..a85d118 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 ================================================================================
 VERSION 1.1.8                                                         XX XX XXXX
 
+    * XnetGrp:
+        - Add footer linking to the group for group-related emails         -XEL
+
 ================================================================================
 VERSION 1.1.7                                                         18 02 2013
 
index db6de53..2565718 100644 (file)
@@ -68,8 +68,28 @@ function _send_xnet_mail($user, $body, $wiki, $mailer, $replyto = null)
         $firstname = $user;
     }
 
+    global $globals;
+    $grp_name = $globals->asso('nom');
+    $grp_short = $globals->asso('diminutif');
+
     $text = str_ireplace(array('<cher>', '<nom>', '<prenom>'),
                          array($dear, $lastname, $firstname), $body);
+    if ($wiki) {
+        $text .= (
+            "\n" .
+            "---- \n" .
+            "Message envoyé pour le groupe [[http://www.polytechnique.net/${grp_short}|${grp_name}]] via les outils de Polytechnique.org \\\\\n" .
+            "[[http://www.polytechnique.net/${grp_short}/annuaire|Annuaire]] | [[http://www.polytechnique.net/${grp_short}/unsubscribe|Se désinscrire]]"
+        );
+    } else {
+        $text .= (
+            "\n" .
+            "---- \n" .
+            "Message envoyé pour le groupe ${grp_name} via les outils de Polytechnique.org\n" .
+            "Annuaire : http://www.polytechnique.net/${grp_short}/annuaire | Désinscription : http://www.polytechnique.net/${grp_short}/unsubscribe"
+        );
+    }
+
     $mailer->setTo($user);
     if ($replyto) {
         $mailer->addHeader('Reply-To', $replyto);