+ if ($user->isActive() && $user->bestEmail()) {
+ $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
+ WHERE asso_id = {?}',
+ $globals->asso('id'));
+ if ($full_count > 999) {
+ XDB::execute(
+ "UPDATE groups
+ SET disable_mails = 1
+ WHERE id = {?}",
+ $globals->asso('id'));
+ }
+