- $mailer = new PlMailer('xnetevents/subscription-notif.mail.tpl');
- $admins = $globals->asso()->iterAdmins();
- while ($admin = $admins->next()) {
- $mailer->addTo($admin);
+ if ($evt['subscription_notification'] != 'nobody') {
+ $mailer = new PlMailer('xnetevents/subscription-notif.mail.tpl');
+ if ($evt['subscription_notification'] != 'creator') {
+ $admins = $globals->asso()->iterAdmins();
+ while ($admin = $admins->next()) {
+ $mailer->addTo($admin);
+ }
+ }
+ if ($evt['subscription_notification'] != 'animator') {
+ $mailer->addTo($evt['organizer']);
+ }
+ $mailer->assign('group', $globals->asso('nom'));
+ $mailer->assign('event', $evt['intitule']);
+ $mailer->assign('subs', $subs);
+ $mailer->assign('moments', $evt['moments']);
+ $mailer->assign('name', S::user()->fullName('promo'));
+ $mailer->send();