Only notifies user about a broken redirection twice a month, fixes a few things.
[platal.git] / include / reminder / ax_letter.inc.php
index c7f62c9..29c1330 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /***************************************************************************
- *  Copyright (C) 2003-2009 Polytechnique.org                              *
+ *  Copyright (C) 2003-2011 Polytechnique.org                              *
  *  http://opensource.polytechnique.org/                                   *
  *                                                                         *
  *  This program is free software; you can redistribute it and/or modify   *
@@ -24,8 +24,8 @@ class ReminderAxLetter extends Reminder
     public function HandleAction($action)
     {
         if ($action == 'yes') {
-            Platal::load('axletter', 'axletter.inc.php');
-            AXLetter::subscribe();
+            require_once 'newsletter.inc.php';
+            NewsLetter::forGroup(NewsLetter::GROUP_AX)->subscribe();
             $this->UpdateOnYes();
         }
 
@@ -52,10 +52,10 @@ class ReminderAxLetter extends Reminder
         return 'Xorg/MailsAX';
     }
 
-    public static function IsCandidate(User &$user, $candidate)
+    public static function IsCandidate(User $user, $candidate)
     {
-        Platal::load('axletter', 'axletter.inc.php');
-        $isSubscribed = AXLetter::subscriptionState();
+        require_once 'newsletter.inc.php';
+        $isSubscribed = NewsLetter::forGroup(NewsLetter::GROUP_AX)->subscriptionState();
         if ($isSubscribed) {
             Reminder::MarkCandidateAsAccepted($user->id(), $candidate);
         }