Browse Source

mailer: return 0 if plugin requested to stop (-1)

Andrew Dolgov 11 months ago
parent
commit
ac5e55c2bd
1 changed files with 4 additions and 1 deletions
  1. 4 1
      classes/mailer.php

+ 4 - 1
classes/mailer.php

@@ -30,8 +30,11 @@ class Mailer {
     foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SEND_MAIL) as $p) {
       $rc = $p->hook_send_mail($this, $params);
 
-      if ($rc == 1 || $rc == -1)
+      if ($rc == 1)
         return $rc;
+
+      if ($rc == -1)
+        return 0;
     }
 
     $headers[] = "From: $from_combined";