|
@@ -873,11 +873,10 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
|
|
|
$smcFunc['db_query']('', '
|
|
|
UPDATE {db_prefix}settings
|
|
|
SET value = {string:next_mail_send}
|
|
|
- WHERE variable = {string:mail_next_send}
|
|
|
+ WHERE variable = {literal:mail_next_send}
|
|
|
AND value = {string:last_send}',
|
|
|
array(
|
|
|
'next_mail_send' => time() + $delay,
|
|
|
- 'mail_next_send' => 'mail_next_send',
|
|
|
'last_send' => $modSettings['mail_next_send'],
|
|
|
)
|
|
|
);
|
|
@@ -912,7 +911,7 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
|
|
|
|
|
|
|
|
|
$request = $smcFunc['db_query']('', '
|
|
|
- SELECT id_mail, recipient, body, subject, headers, send_html, time_sent
|
|
|
+ SELECT id_mail, recipient, body, subject, headers, send_html, time_sent, private
|
|
|
FROM {db_prefix}mail_queue
|
|
|
ORDER BY priority ASC, id_mail ASC
|
|
|
LIMIT ' . $number,
|
|
@@ -932,6 +931,7 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
|
|
|
'headers' => $row['headers'],
|
|
|
'send_html' => $row['send_html'],
|
|
|
'time_sent' => $row['time_sent'],
|
|
|
+ 'private' => $row['private'],
|
|
|
);
|
|
|
}
|
|
|
$smcFunc['db_free_result']($request);
|
|
@@ -953,11 +953,10 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
|
|
|
$smcFunc['db_query']('', '
|
|
|
UPDATE {db_prefix}settings
|
|
|
SET value = {string:no_send}
|
|
|
- WHERE variable = {string:mail_next_send}
|
|
|
+ WHERE variable = {literal:mail_next_send}
|
|
|
AND value = {string:last_mail_send}',
|
|
|
array(
|
|
|
'no_send' => '0',
|
|
|
- 'mail_next_send' => 'mail_next_send',
|
|
|
'last_mail_send' => $modSettings['mail_next_send'],
|
|
|
)
|
|
|
);
|
|
@@ -995,7 +994,7 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
|
|
|
|
|
|
|
|
|
if (!$result)
|
|
|
- $failed_emails[] = array($email['to'], $email['body'], $email['subject'], $email['headers'], $email['send_html'], $email['time_sent']);
|
|
|
+ $failed_emails[] = array($email['to'], $email['body'], $email['subject'], $email['headers'], $email['send_html'], $email['time_sent'], $email['private']);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1013,19 +1012,18 @@ function ReduceMailQueue($number = false, $override_limit = false, $force_send =
|
|
|
if ($modSettings['mail_failed_attempts'] > 5)
|
|
|
$smcFunc['db_query']('', '
|
|
|
UPDATE {db_prefix}settings
|
|
|
- SET value = {string:mail_next_send}
|
|
|
- WHERE variable = {string:next_mail_send}
|
|
|
+ SET value = {string:next_mail_send}
|
|
|
+ WHERE variable = {literal:mail_next_send}
|
|
|
AND value = {string:last_send}',
|
|
|
array(
|
|
|
'next_mail_send' => time() + 60,
|
|
|
- 'mail_next_send' => 'mail_next_send',
|
|
|
'last_send' => $modSettings['mail_next_send'],
|
|
|
));
|
|
|
|
|
|
|
|
|
$smcFunc['db_insert']('insert',
|
|
|
'{db_prefix}mail_queue',
|
|
|
- array('recipient' => 'string', 'body' => 'string', 'subject' => 'string', 'headers' => 'string', 'send_html' => 'string', 'time_sent' => 'string'),
|
|
|
+ array('recipient' => 'string', 'body' => 'string', 'subject' => 'string', 'headers' => 'string', 'send_html' => 'string', 'time_sent' => 'string', 'private' => 'int'),
|
|
|
$failed_emails,
|
|
|
array('id_mail')
|
|
|
);
|