I create two versions of the newsletter, in HTML and in text-only.
HTML: http://www.bioedge.org/index.php/tools/newsletter_/ TEXT-ONLY: http://www.bioedge.org/index.php/tools/newsletter_text
The problem is that when I created the text-only newsletter, there are all sorts of ASCII symbols in it and it takes a lot of time to replace them. Also, all the tags disappear, so some of the text looks like solid blocks rather than separate paragraphs. Would it be possible to fix?
Followings are the templates for Text-only Newsletter:-
newsletter_text
<?
error_reporting(0);
global $LOC;
$current_time = $LOC->decode_date('%Y-%m-%d %g:%i %A', $LOC->now - 604800);
//$text = {embed='tools/newsletter_data' date='$current_time'}
//$text = "{exp:eexcerpt if_exceeds="60" stop_after="50"}{embed='tools/newsletter_data 'date='$current_time'}{/exp:eexcerpt}";
$text = "{embed='tools/newsletter_data' date='$current_time'}";
$ext = "txt";
$today = date("dmY");
$filename = "newsletter_".$today;
$mime_type = (PMA_USR_BROWSER_AGENT == 'IE' || PMA_USR_BROWSER_AGENT == 'OPERA')
? 'application/octetstream'
: 'application/octet-stream';
header('Content-Type: ' . $mime_type);
if (PMA_USR_BROWSER_AGENT == 'IE') {
header('Content-Disposition: inline; filename="' . $filename . '.' . $ext . '"');
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
} else {
header('Content-Disposition: attachment; filename="' . $filename . '.' . $ext . '"');
header("Content-Transfer-Encoding: binary");
header('Expires: 0');
header('Pragma: no-cache');
};
function htmlspecialchars_decode_php4 ($str, $quote_style = ENT_QUOTES) {
return strtr($str, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style)));
}
echo ($text);
?>newsletter_data
=========================================================
BioEDGE
Bioethics news from around the world
www.BioEdge.org
Weekly Update --{current_time format="%l, %F %d, %Y"}
=========================================================
THIS WEEK IN BIOEDGE
{exp:replace find=""|‘|’|’" replace="'" regex="yes"}{exp:weblog:entries weblog="bioedge" status="front page|not closed|editing" orderby="date" sort="desc" start_on="{embed:date}" rdf="off"}
* {title}{/exp:weblog:entries}{/exp:replace}
=========================================================
For a HTML version of BioEdge, click on this link to our website:
http://www.bioedge.org/
=========================================================
{exp:replace find=""|‘|’|’" replace="'" casesensitive= "no" regex="yes"}{exp:weblog:entries weblog="bioedge" status="front page|not closed|editing" orderby="date" sort="desc" start_on="{embed:date}" rdf="off"}{exp:php_text_format type="uppercase"}{exp:html_strip convert="y"}{title}{/exp:html_strip}{/exp:php_text_format}
{exp:html_strip convert="y" convert_back="all"}{body}=========================================================
{/exp:html_strip}{/exp:weblog:entries}{/exp:replace}BioEdge
Edited by Michael Cook: [email protected]
A publication of New Media Foundation Ltd
ACN 113 716 153
Postal address: PO Box 1338 | Carlton | Victoria 3053 | Australia
Phone and fax: 61+3 9667-0240
=========================================================Howdy, MINDSCREEN -
This is a lot of custom PHP and queries, so I am going to move it to Development and Programming. The supported way of doing mailing lists would be to use our built in Mailing List.
if you need complex templates, you might consider something like MailChimp, Campaign Monitor, or Constant Contact - all of which have third-party add-ons to integrate with EE as well, which you can find on Devot-ee
I hope that helps!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.