forked from tin-cat/emailqueue
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflush.php
More file actions
executable file
·45 lines (36 loc) · 723 Bytes
/
Copy pathflush.php
File metadata and controls
executable file
·45 lines (36 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/*
EMailqueue
Flush
*/
include_once dirname(__FILE__)."/../common.inc.php";
header("content-type: text/plain");
set_time_limit(0);
echo date("j/n/Y H:i.s")." Emailqueue:Flush";
$db->query("
select
id
from
emails
where
is_sendingnow = 0
");
if (!$db->isanyresult()) {
echo " [No emails to flush]\n";
}
else {
$count = 0;
while ($row = $db->fetchrow()) {
$email_ids[] = $row["id"];
$count ++;
}
$count = 0;
foreach ($email_ids as $email_id) {
$db->query("delete from emails where id = ".$email_id);
$db->query("delete from incidences where email_id = ".$email_id);
$count ++;
}
echo " [".$count." emails purged]\n";
}
$db->disconnect();
?>