from="Polytechnique.org" <support@polytechnique.org>
cc=validation+googleapps@polytechnique.org
+[xnet_forced_subscription]
+from="Gestion des groupes X sur Polytechnique.net" <support@polytechnique.org>
+
[xnet_unsubscription]
from="Gestion des groupes X sur Polytechnique.net" <support@polytechnique.org>
Group::subscribe($globals->asso('id'), $user->id());
$this->removeSubscriptionRequest($user->id());
-
+ if ($user->isActive()) {
+ $mailer = new PlMailer('xnetgrp/forced-subscription.mail.tpl');
+ $mailer->addTo($user->bestEmail());
+ $mailer->assign('group', $globals->asso('nom'));
+ $mailer->assign('anim', S::user()->fullname());
+ $mailer->assign('diminutif', $globals->asso('diminutif'));
+ $mailer->send();
+ }
+
// Check if the group has more than 1000 members, if so, disable the "send mail" function.
$full_count = XDB::fetchOneCell('SELECT COUNT(*)
FROM group_members
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2013 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+{config_load file="mails.conf" section="xnet_forced_subscription"}
+{if $mail_part eq 'head'}
+{from full=#from#}
+{to addr="$to"}
+{subject text="Inscription au groupe $group"}
+{elseif $mail_part eq 'wiki'}
+Bonjour,
+
+Tu viens d'être inscrit au groupe {$group} sur Polytechnique.net par l'animateur de celui-ci, {$anim}. Si tu es opposé à cette inscription, tu peux l'annuler en cliquant [[http://www.polytechnique.net/{$diminutif}/unsubscribe|sur ce lien]].
+{/if}
+{include file="include/signature.mail.tpl"}
+
+{* vim:set et sw=2 sts=2 sws=2: *}
<ul class='descr'>
<li>
Pour ajouter un X dans ton groupe, il suffit d'entrer ici une de ses
- adresses email @polytechnique.org.
+ adresses email @polytechnique.org. Celui-ci sera prévenu de son inscription.
</li>
<li>
S'il s'agit d'un X qui n'est pas inscrit à Polytechnique.org, il faut