Moving to GitHub.
[platal.git] / bin / newsletter.send.php
index 4b0d456..1d56351 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/php5 -q
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2010 Polytechnique.org                              *
+ *  Copyright (C) 2003-2014 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -23,6 +23,7 @@
 require_once 'connect.db.inc.php';
 require_once 'plmailer.php';
 require_once 'newsletter.inc.php';
+ini_set('memory_limit', '128M');
 
 $opt = getopt('i:h');
 
@@ -35,8 +36,9 @@ EOF;
 }
 
 $id = intval($opt['i']);
-$nl = new NewsLetter($id);
-$nl->sendToAll();
+$nl = NewsLetter::forGroup(NewsLetter::GROUP_XORG);
+$issue = $nl->getIssue($id);
+$issue->sendToAll();
 
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
 ?>