Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Newsletter link?


gizmodesign

Recommended Posts

Is it possible to add a link outside of the cart for newsletter sign-ups? Something independent of logins.

 

thanks!

If you are familiar with PHP, You could create a new table called newsletter_extra in your osc database, it contains name, email_address.

And then create an opt-in in your store's front-end to collect these information.

Then you could modify catalog/admin/includes/modules/newsleter.php, about line 59 you will find:

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

  $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
  $mimemessage->add_text($this->content);
  $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) . "'");
}

 

and replace 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'");
//modify begin
  $simba_query = tep_db_query("select name, email_address from newsletter_extra");
//modify end  
  $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer'));
  $mimemessage->add_html($this->content);
  $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);
  }
//modify begin
  while ($simba = tep_db_fetch_array($simba_query)) {
	$mimemessage->send($simba['name'], $simba['email_address'], '', EMAIL_FROM, $this->title);
  }
//modify end 
  $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 hope these will help you.

Everyone is changing the world.

Everyone is a world.

For everyone needs my help, PM or email if I amn't online.

Link to comment
Share on other sites

  • 3 years later...

Hello

 

I would like to do the same thing to where I can have just a newsletter sign up with out the account sign up and use the back door newsletter to send out the newsletter. HELP. I'm very new to OSC. Tried many others just found this about 2 months ago and love it. Can anyone show me how to set this up or contact me. Need this ASAP please. Also looking how to change the colors or add themes. Thanks Frank Manteau Email me

Link to comment
Share on other sites

Phplist is the best (free) newsletter manager in my opinion. This is easily skinable to make it look like your own and comes with a built in wysiwyg.

Link to comment
Share on other sites

I want only 1 way to send out a newsletter If the OSC customer can be added to phplist I'm game but only want to deal with only 1 program. OSC or PHPlist but not both.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...