MOVED DataObjects/Core_notify_sender+blacklist.php to DataObjects/Core_notify_sender_...
authorAlan <alan@roojs.com>
Thu, 2 Nov 2023 06:31:23 +0000 (14:31 +0800)
committerAlan <alan@roojs.com>
Thu, 2 Nov 2023 06:31:23 +0000 (14:31 +0800)
DataObjects/Core_notify_sender_blacklist.php [new file with mode: 0644]

diff --git a/DataObjects/Core_notify_sender_blacklist.php b/DataObjects/Core_notify_sender_blacklist.php
new file mode 100644 (file)
index 0000000..fae68a5
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Table Definition for core_notify_blacklist_sender
+ */
+class_exists('DB_DataObject') ? '' : require_once 'DB/DataObject.php';
+
+class Pman_Core_DataObjects_Core_notify_blacklist_sender extends DB_DataObject 
+{
+    ###START_AUTOCODE
+    /* the code below is auto generated do not remove the above tag */
+
+    public $__table = 'core_notify_blacklist_sender';    // table name
+    public $id;                              // int(11)  not_null primary_key auto_increment
+    public $sender_id;
+    public $domain_id;
+    public $error_msg;
+    public $added_dt;
+     
+    function messageIsBlacklisted($err)
+    {
+        $match = array(
+        
+        );
+        foreach($match as $str) {
+            if (strpos($err, $str) !== false) {
+                return true;
+            }
+        }
+        return false;
+    }
+    
+    // delete blacklists older than 1 week (and try again)
+    function prune()
+    {
+        $this->query("
+            DELETE FROM {$this->tableName()} where added_dt < NOW()  - INTERVAL 1 WEEK
+        ");
+            
+    }
+    
+}
\ No newline at end of file