X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2Fmail%2Finit.php;h=3b1582081d885d82097a2eb630f90a88c1a97e25;hb=f766373271b4d388597f95ef2a55d028fcbca8f1;hp=2897068aa5635598f85c75428cefe9b392be784e;hpb=a42c55f02b7e313ab61bf826794d0888f2dceae1;p=tt-rss.git diff --git a/plugins/mail/init.php b/plugins/mail/init.php index 2897068a..3b158208 100644 --- a/plugins/mail/init.php +++ b/plugins/mail/init.php @@ -50,13 +50,16 @@ class Mail extends Plugin { $tpl = new MiniTemplator; $tpl_t = new MiniTemplator; - $tpl->readTemplateFromFile("templates/email_article_template.txt"); + $templ_name = "templates/email_article_template.txt"; + if(file_exists("templates/my_email_article_template.txt")) + $templ_name = "templates/my_email_article_template.txt"; + $tpl->readTemplateFromFile($templ_name); $tpl->setVariable('USER_NAME', $_SESSION["name"], true); $tpl->setVariable('USER_EMAIL', $user_email, true); $tpl->setVariable('TTRSS_HOST', $_SERVER["HTTP_HOST"], true); - $result = db_query("SELECT link, content, title + $result = db_query("SELECT link, content, title, note FROM ttrss_user_entries, ttrss_entries WHERE id = ref_id AND id IN ($param) AND owner_uid = " . $_SESSION["uid"]); @@ -70,6 +73,11 @@ class Mail extends Plugin { $subject = __("[Forwarded]") . " " . htmlspecialchars($line["title"]); $tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"])); + $tnote = strip_tags($line["note"]); + if( $tnote != ''){ + $tpl->setVariable('ARTICLE_NOTE', $tnote, true); + $tpl->addBlock('note'); + } $tpl->setVariable('ARTICLE_URL', strip_tags($line["link"])); $tpl->addBlock('article'); @@ -136,7 +144,10 @@ class Mail extends Plugin { $mail->From = strip_tags($_REQUEST['from_email']); $mail->FromName = strip_tags($_REQUEST['from_name']); - $mail->AddAddress($_REQUEST['destination']); + //$mail->AddAddress($_REQUEST['destination']); + $addresses = explode(';', $_REQUEST['destination']); + foreach($addresses as $nextaddr) + $mail->AddAddress($nextaddr); $mail->IsHTML(false); $mail->Subject = $_REQUEST['subject']; @@ -168,6 +179,9 @@ class Mail extends Plugin { print ""; } + function api_version() { + return 2; + } } ?>