summaryrefslogtreecommitdiff
path: root/classes/digest.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-11-22 14:45:14 +0300
committerAndrew Dolgov <[email protected]>2018-11-22 14:45:14 +0300
commit57932e183745bada9c6183056597cb5276f68d10 (patch)
tree7d64a815dd4bbf40dec51ee95be16c4ef7f7a212 /classes/digest.php
parent643d1919cc27a80aff424970b337e83be72720d1 (diff)
remove PHPMailer and related directives from config.php-dist; add pluggable Mailer class
Diffstat (limited to 'classes/digest.php')
-rw-r--r--classes/digest.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/classes/digest.php b/classes/digest.php
index 75dda4984..641fbe97f 100644
--- a/classes/digest.php
+++ b/classes/digest.php
@@ -11,8 +11,6 @@ class Digest
*/
static function send_headlines_digests($debug = false) {
- require_once 'classes/ttrssmailer.php';
-
$user_limit = 15; // amount of users to process (e.g. emails to send out)
$limit = 1000; // maximum amount of headlines to include
@@ -56,11 +54,16 @@ class Digest
if ($headlines_count > 0) {
- $mail = new ttrssMailer();
+ $mailer = new Mailer();
+
+ //$rc = $mail->quickMail($line["email"], $line["login"], DIGEST_SUBJECT, $digest, $digest_text);
- $rc = $mail->quickMail($line["email"], $line["login"], DIGEST_SUBJECT, $digest, $digest_text);
+ $rc = $mailer->mail(["to" => $line["login"] . " <" . $line["email"] . ">",
+ "subject" => DIGEST_SUBJECT,
+ "message" => $digest_text,
+ "message_html" => $digest]);
- if (!$rc && $debug) _debug("ERROR: " . $mail->ErrorInfo);
+ //if (!$rc && $debug) _debug("ERROR: " . $mailer->lastError());
if ($debug) _debug("RC=$rc");
@@ -198,4 +201,4 @@ class Digest
return array($tmp, $headlines_count, $affected_ids, $tmp_t);
}
-} \ No newline at end of file
+}