From 6dd01fcea230dc96bd3955aa74cf16aa1c5c17ca Mon Sep 17 00:00:00 2001 From: justauser Date: Sun, 26 May 2013 11:27:42 -0400 Subject: Changes to support a new version of the phpmailer. Adds a new setting SMTP_SECURE, which cna have a value of tls, ssl or be empty. This is used for secure SMTP servers. Also added the ability to have multiple email addresses in the to field. Addresses are separated by semicolons (;) --- plugins/mail/init.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins/mail') diff --git a/plugins/mail/init.php b/plugins/mail/init.php index 80bc7d417..626fe8717 100644 --- a/plugins/mail/init.php +++ b/plugins/mail/init.php @@ -136,7 +136,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 = preg_split('/;/', $_REQUEST['destination'],-1,PREG_SPLIT_NO_EMPTY); + foreach($addresses as $nextaddr) + $mail->AddAddress($nextaddr); $mail->IsHTML(false); $mail->Subject = $_REQUEST['subject']; -- cgit v1.2.3 From 2e937560dfada30b398760308ce11f08c205d468 Mon Sep 17 00:00:00 2001 From: justauser Date: Mon, 27 May 2013 12:07:56 -0400 Subject: Added the note text to the body of the email sending articles --- plugins/mail/init.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/mail') diff --git a/plugins/mail/init.php b/plugins/mail/init.php index 626fe8717..a7efcf273 100644 --- a/plugins/mail/init.php +++ b/plugins/mail/init.php @@ -56,7 +56,7 @@ class Mail extends Plugin { $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"]); @@ -71,6 +71,7 @@ class Mail extends Plugin { $tpl->setVariable('ARTICLE_TITLE', strip_tags($line["title"])); $tpl->setVariable('ARTICLE_URL', strip_tags($line["link"])); + $tpl->setVariable('ARTICLE_NOTE', strip_tags($line["note"])); $tpl->addBlock('article'); } -- cgit v1.2.3 From ed7dd4bf6c8c94e740b32b17545b5fe60fedc1f0 Mon Sep 17 00:00:00 2001 From: justauser Date: Wed, 29 May 2013 08:06:05 -0400 Subject: changed the preg_split to explode per fox. fixed the template to have a block for note and only include if there is a note --- plugins/mail/init.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'plugins/mail') diff --git a/plugins/mail/init.php b/plugins/mail/init.php index a7efcf273..5b61c2355 100644 --- a/plugins/mail/init.php +++ b/plugins/mail/init.php @@ -70,8 +70,12 @@ 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->setVariable('ARTICLE_NOTE', strip_tags($line["note"])); $tpl->addBlock('article'); } @@ -138,7 +142,7 @@ class Mail extends Plugin { $mail->From = strip_tags($_REQUEST['from_email']); $mail->FromName = strip_tags($_REQUEST['from_name']); //$mail->AddAddress($_REQUEST['destination']); - $addresses = preg_split('/;/', $_REQUEST['destination'],-1,PREG_SPLIT_NO_EMPTY); + $addresses = explode(';', $_REQUEST['destination']); foreach($addresses as $nextaddr) $mail->AddAddress($nextaddr); -- cgit v1.2.3 From f766373271b4d388597f95ef2a55d028fcbca8f1 Mon Sep 17 00:00:00 2001 From: justauser Date: Wed, 29 May 2013 16:23:04 -0400 Subject: added a personalized email template. if the file: my_email_article_template.txt exists it will be used, otherwise the default will be used --- plugins/mail/init.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins/mail') diff --git a/plugins/mail/init.php b/plugins/mail/init.php index 5b61c2355..3b1582081 100644 --- a/plugins/mail/init.php +++ b/plugins/mail/init.php @@ -50,7 +50,10 @@ 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); -- cgit v1.2.3