Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

HTML Newsletter


pjones

Recommended Posts

I'm having problems getting the newsletter module to send HTML newsletters in V2.2. I see Steve Kemp's thread suggests a solution by modifying newsletter.php with:

 

function send($newsletter_id) {

$mail_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_newsletter = '1'");

 

// Instantiate a new mail object

$mimemessage = new email(array('X-Mailer: osC mailer'));

 

// Build the text version

$text = strip_tags($text);

if (EMAIL_USE_HTML == 'true') {

$mimemessage->add_html($this->content);

} else {

$mimemessage->add_text($this->content);

}

 

// Send message

$mimemessage->build_message();

while ($mail = tep_db_fetch_array($mail_query)) {

$mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title);

}

$newsletter_id = tep_db_prepare_input($newsletter_id);

tep_db_query("update " . TABLE_NEWSLETTERS . " set date_sent = now(), status = '1' where newsletters_id = '" . tep_db_input($newsletter_id) . "'");

}

}

?>

 

 

I've tried this and with the email option set to HTML true I get a crash in email.php. With the email option set to HTML false the newsletter comes through as HTML code only.

 

Has anyone got this working?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...