Unsubscribes user from groupNL when unsubscribing from group.
authorAnne Limoges <anne.limoges_git@polytechnique.org>
Sat, 8 Mar 2014 13:38:55 +0000 (14:38 +0100)
committerAnne Limoges <anne.limoges_git@polytechnique.org>
Sat, 8 Mar 2014 13:39:04 +0000 (14:39 +0100)
modules/xnetgrp.php

index cc39f46..0a40bae 100644 (file)
@@ -1222,6 +1222,11 @@ class XnetGrpModule extends PLModule
             $mailer->send();
         }
 
+        $nl = Newsletter::forGroup($globals->asso('shortname'));
+        if (!is_null($nl)) {
+            $nl->unsubscribe(null, S::i('uid'));
+        }
+
         $domain = $globals->asso('mail_domain');
         if (!$domain) {
             return true;