- SET id = {?}, shortname = {?}, subject = {?}, title = {?}, body = {?},
- signature = {?}, promo_min = {?}, promo_max = {?}, echeance = {?}",
- $id, $shortname, $subject, $title, $body, $signature, $promo_min, $promo_max, $echeance);
+ SET id = {?}, short_name = {?}, subject = {?}, title = {?}, body = {?},
+ signature = {?}, promo_min = {?}, promo_max = {?}, echeance = {?}, subset = {?}",
+ $id, $short_name, $subject, $title, $body, $signature, $promo_min, $promo_max, $echeance, $subset ? implode("\n", $subset_to) : null);
+ if (!$saved) {
+ global $globals;
+ $mailer = new PlMailer();
+ $mailer->setFrom("support@" . $globals->mail->domain);
+ $mailer->setSubject("Un nouveau projet d'email de l'AX vient d'être proposé");
+ $mailer->setTxtBody("Un nouvel email vient d'être rédigé en prévision d'un envoi prochain. Vous pouvez "
+ . "le modifier jusqu'à ce qu'il soit verrouillé pour l'envoi\n\n"
+ . "Le sujet de l'email : $subject\n"
+ . "L'échéance d'envoi est fixée à $echeance.\n"
+ . "L'email pourra néanmoins partir avant cette échéance si un administrateur de "
+ . "Polytechnique.org le valide.\n\n"
+ . "Pour modifier, valider ou annuler l'email :\n"
+ . "https://www.polytechnique.org/ax/edit\n"
+ . "-- \n"
+ . "Association Polytechnique.org\n");
+ $users = User::getBulkUsersWithUIDs(XDB::fetchColumn('SELECT user_id
+ FROM axletter_rights'));
+ foreach ($users as $user) {
+ $mailer->addTo($user);
+ }
+ $mailer->send();
+ }