from="Polytechnique.org" <validation_modification@polytechnique.org>
cc="Polytechnique.org" <validation_modification@polytechnique.org>
+[newsletter_schedule_mailing]
+from="Gestion des NLs" <support@polytechnique.org>
+to=br@staff.polytechnique.org
WHERE id = {?}',
$this->id);
if ($success) {
+ global $globals;
+ $mailer = new PlMailer('newsletter/notify_scheduled.mail.tpl');
+ $mailer->assign('group', $this->nl->group);
+ $mailer->assign('nl_title', $this->title_mail);
+ $mailer->assign('nl_id', $this->id());
+ $mailer->assign('base', $globals->baseurl);
+ $mailer->assign('send_before', $this->send_before);
+ $mailer->send();
$this->refresh();
}
return $success;
// }}}
// {{{ Mailing
-
+
+ /** Check whether this issue is empty
+ * An issue is empty if the email has no title (or the default one), or no articles and an empty head.
+ */
+ public function isEmpty()
+ {
+ return $this->mail_title == '' || $this->mail_title == 'to be continued' || (count($this->arts == 0 && strlen($this->head) == 0));
+ }
+
/** Retrieve the 'Send before' date, in a clean format.
*/
public function getSendBeforeDate()
$ufc = new PFC_And($this->getRecipientsUFC(), new UFC_NLSubscribed($this->nl->id, $this->id), new UFC_HasEmailRedirect());
$emailsCount = 0;
- $uf = new UserFilter($ufc);
+ $uf = new UserFilter($ufc, array(new UFO_IsAdmin(), new UFO_Uid()));
$limit = new PlLimit(self::BATCH_SIZE);
while (true) {
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2011 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="newsletter_schedule_mailing"}
+{if $mail_part eq 'head'}
+{from full=#from#}
+{to addr=#to#}
+{subject text="Validation de l'envoi d'une NL du groupe $group"}
+{elseif $mail_part eq 'text'}
+
+L'envoi d'une NL pour le groupe {$group}, "{$nl_title}", a été planifié pour le {$send_before}.
+
+Aperçu / édition :
+{$base}/newsletter/admin/edit/{$nl_id}
+
+{/if}
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}