From 6f687c928cd7594271b4a389cb1511b951cf3ec0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Wed, 24 Apr 2013 00:54:16 +0200 Subject: [PATCH] groups: Add footer to xnet-sent emails. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- ChangeLog | 3 +++ modules/xnetgrp/mail.inc.php | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index cc7b5b7..a85d118 100644 --- 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 diff --git a/modules/xnetgrp/mail.inc.php b/modules/xnetgrp/mail.inc.php index db6de53..2565718 100644 --- a/modules/xnetgrp/mail.inc.php +++ b/modules/xnetgrp/mail.inc.php @@ -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('', '', ''), 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); -- 2.1.4