From: Raphaël Barrois Date: Tue, 23 Apr 2013 22:54:16 +0000 (+0200) Subject: groups: Add footer to xnet-sent emails. X-Git-Tag: xorg/1.1.8~7 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=6f687c928cd7594271b4a389cb1511b951cf3ec0;p=platal.git groups: Add footer to xnet-sent emails. Signed-off-by: Raphaël Barrois --- 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);