Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Newsletter & Subscribtion for MS2


Gyakutsuki

Recommended Posts

I've installed the latest version, everything seems to be ok until I go to Newsletter Manager and attempt to send the emails.

 

I'm getting the following error message:

 

Fatal error: Call to undefined function: add_html_newsletter() in /home/******/public_html/shop/admin/includes/modules/newsletters/newsletter_subscribers.php on line 109

 

The newsletter_subscribers.php is the file that was included with the MOD, I've set HMTL emails as true in the configuration, can anyone help me out with this.

 

Thanks in advance.

Link to comment
Share on other sites

  • Replies 336
  • Created
  • Last Reply

Top Posters In This Topic

I've installed the latest version, everything seems to be ok until I go to Newsletter Manager and attempt to send the emails.

 

I'm getting the following error message:

 

Fatal error: Call to undefined function: add_html_newsletter() in /home/******/public_html/shop/admin/includes/modules/newsletters/newsletter_subscribers.php on line 109

 

The newsletter_subscribers.php is the file that was included with the MOD, I've set HMTL emails as true in the configuration, can anyone help me out with this.

 

Thanks in advance.

 

OK I've got that bit sorted - I hadn't made the changes to admin/includes/classes/email.php, now that I have I'm getting this message on the admin screen.

 

Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/******/public_html/shop/admin/includes/classes/email.php on line 158

 

The code here is:

 

/**
* Adds a html part to the mail.
* Also replaces image names with
* content-id's.
*/
// ################# Contribution Newsletter v050 ##############
 define('FILENAME_NEWSLETTERS_SUBSCRIBERS', 'newsletter_subscribers.php');
 define('FILENAME_NEWSLETTERS_UNSUBSCRIBE', 'newsletters_unsubscribe.php');
 define('FILENAME_NEWSLETTERS_EXTRA_INFOS', 'newsletters_extra_infos.php');
 define('FILENAME_NEWSLETTERS_UPDATE', 'newsletters_update.php');
 define('FILENAME_NEWSLETTERS_SUBSCRIBERS_VIEW', 'newsletters_subscribers_view.php');
 define('FILENAME_POPUP_HELP', 'popup_help.php');
 define('FILENAME_MAILS', 'mails.php');
 define('FILENAME_NEWSLETTERS_EXTRA_DEFAULT', 'newsletters_extra_default.php');
 define('FILENAME_UNSUBSCRIBE', 'unsubscribe.php');
// ################# END - Contribution Newsletter v050 ##############
function add_html($html, $text = NULL, $images_dir = NULL) {
  $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br>', $html);
  $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);

  if (isset($images_dir)) $this->find_html_images($images_dir);
}

 

Any help would be greatly appreciated.

Link to comment
Share on other sites

OK I've got that bit sorted - I hadn't made the changes to admin/includes/classes/email.php, now that I have I'm getting this message on the admin screen.

 

Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/******/public_html/shop/admin/includes/classes/email.php on line 158

 

The code here is:

 

/**
* Adds a html part to the mail.
* Also replaces image names with
* content-id's.
*/
// ################# Contribution Newsletter v050 ##############
 define('FILENAME_NEWSLETTERS_SUBSCRIBERS', 'newsletter_subscribers.php');
 define('FILENAME_NEWSLETTERS_UNSUBSCRIBE', 'newsletters_unsubscribe.php');
 define('FILENAME_NEWSLETTERS_EXTRA_INFOS', 'newsletters_extra_infos.php');
 define('FILENAME_NEWSLETTERS_UPDATE', 'newsletters_update.php');
 define('FILENAME_NEWSLETTERS_SUBSCRIBERS_VIEW', 'newsletters_subscribers_view.php');
 define('FILENAME_POPUP_HELP', 'popup_help.php');
 define('FILENAME_MAILS', 'mails.php');
 define('FILENAME_NEWSLETTERS_EXTRA_DEFAULT', 'newsletters_extra_default.php');
 define('FILENAME_UNSUBSCRIBE', 'unsubscribe.php');
// ################# END - Contribution Newsletter v050 ##############
function add_html($html, $text = NULL, $images_dir = NULL) {
  $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br>', $html);
  $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);

  if (isset($images_dir)) $this->find_html_images($images_dir);
}

 

Any help would be greatly appreciated.

 

bump - please can someone help me :blush:

Link to comment
Share on other sites

Try this code here. Looks like the code is missing a termination bracket near if (isset($images_dir))

 

should be:

 

if (isset($images_dir)) {

 

 

/**

* Adds a html part to the mail.

* Also replaces image names with

* content-id's.

*/

// ################# Contribution Newsletter v050 ##############

define('FILENAME_NEWSLETTERS_SUBSCRIBERS', 'newsletter_subscribers.php');

define('FILENAME_NEWSLETTERS_UNSUBSCRIBE', 'newsletters_unsubscribe.php');

define('FILENAME_NEWSLETTERS_EXTRA_INFOS', 'newsletters_extra_infos.php');

define('FILENAME_NEWSLETTERS_UPDATE', 'newsletters_update.php');

define('FILENAME_NEWSLETTERS_SUBSCRIBERS_VIEW', 'newsletters_subscribers_view.php');

define('FILENAME_POPUP_HELP', 'popup_help.php');

define('FILENAME_MAILS', 'mails.php');

define('FILENAME_NEWSLETTERS_EXTRA_DEFAULT', 'newsletters_extra_default.php');

define('FILENAME_UNSUBSCRIBE', 'unsubscribe.php');

// ################# END - Contribution Newsletter v050 ##############

function add_html($html, $text = NULL, $images_dir = NULL) {

$this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br>', $html);

$this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);

 

if (isset($images_dir)) {

$this->find_html_images($images_dir);

}

Link to comment
Share on other sites

  • 3 weeks later...
Try this code here. Looks like the code is missing a termination bracket near if (isset($images_dir))

 

should be:

 

if (isset($images_dir)) {

/**

* Adds a html part to the mail.

* Also replaces image names with

* content-id's.

*/

// ################# Contribution Newsletter v050 ##############

define('FILENAME_NEWSLETTERS_SUBSCRIBERS', 'newsletter_subscribers.php');

define('FILENAME_NEWSLETTERS_UNSUBSCRIBE', 'newsletters_unsubscribe.php');

define('FILENAME_NEWSLETTERS_EXTRA_INFOS', 'newsletters_extra_infos.php');

define('FILENAME_NEWSLETTERS_UPDATE', 'newsletters_update.php');

define('FILENAME_NEWSLETTERS_SUBSCRIBERS_VIEW', 'newsletters_subscribers_view.php');

define('FILENAME_POPUP_HELP', 'popup_help.php');

define('FILENAME_MAILS', 'mails.php');

define('FILENAME_NEWSLETTERS_EXTRA_DEFAULT', 'newsletters_extra_default.php');

define('FILENAME_UNSUBSCRIBE', 'unsubscribe.php');

// ################# END - Contribution Newsletter v050 ##############

function add_html($html, $text = NULL, $images_dir = NULL) {

$this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br>', $html);

$this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);

 

if (isset($images_dir)) {

$this->find_html_images($images_dir);

}

 

I've made that change but now when I go to the admin section I get the following message:

 

Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/******/public_html/shop/admin/includes/classes/email.php on line 158

 

Line 158 is:

define('FILENAME_NEWSLETTERS_SUBSCRIBERS', 'newsletter_subscribers.php');

Edited by DawnG
Link to comment
Share on other sites

This is probably an easy fix, but it doesn't seem to be addressed. The instructions direct to:

2 - DELETE in SQL your old newsletters since the admin otherwise it provokes an error SQL.

use DROP TABLE `newsletters`

 

Now when I click on Newsletters in the admin menu I get the following error:

Newsletter Manager

1146 - Table '*********.newsletters' doesn't exist

 

select count(*) as total from newsletters

 

[TEP STOP]

 

Has anyone fixed this?

Link to comment
Share on other sites

I've made that change but now when I go to the admin section I get the following message:

 

Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/******/public_html/shop/admin/includes/classes/email.php on line 158

 

Line 158 is:

define('FILENAME_NEWSLETTERS_SUBSCRIBERS', 'newsletter_subscribers.php');

 

bump :-"

Link to comment
Share on other sites

Hi, I installed last 0.54 version and the "Automatic update of subscribers_table" modification from anorakgirl. almost everything seems to work fine but if I unregister a user in the admin then, create a new mail, when I go back to the "subscribers manager", the unregistered users a registered again. it looks like the synchronisation system overrides the "subscribed newsletter" flag.

 

I modified the tep_set_newsletter_status function like this to solve my problem. hope it helps :

 

  function tep_set_newsletter_status($subscribers_id, $status) {

	$select_str = "select p.customers_id ";
	$from_str .= "from " . TABLE_SUBSCRIBERS . " p ";
	$where = "where p.subscribers_id=" .(int)$subscribers_id;
	$listing_sql = $select_str . $from_str . $where;
	$listing = tep_db_query($listing_sql);

	if (tep_db_num_rows($listing)) {
		$listing_values = tep_db_fetch_array($listing);
		$customer_id = $listing_values['customers_id'];
	}

if ($status == '1') {
		if ($customer_id != 0) {
				$maj_customer =  tep_db_query("update " . TABLE_CUSTOMERS . " set customers_newsletter = '1' where customers_id = '" . (int)$customer_id . "'");
		}
  return tep_db_query("update " . TABLE_SUBSCRIBERS . " set customers_newsletter = '1' where subscribers_id = '" . (int)$subscribers_id . "'");
} elseif ($status == '0') {
	if ($customer_id != 0) {
			$maj_customer =  tep_db_query("update " . TABLE_CUSTOMERS . " set customers_newsletter = '0' where customers_id = '" . (int)$customer_id . "'");
	}
  return tep_db_query("update " . TABLE_SUBSCRIBERS . " set customers_newsletter = '0' where subscribers_id = '" . (int)$subscribers_id . "'");
} else {
  return -1;
}
 }

 

Hi - I'm having a similar problem, if I change the status in admin, then update the table, it goes back to what it was. I found your post, but I don't understand where you've added/modified the code? what file is it?

 

Thanks!

 

~bobsi18~

Link to comment
Share on other sites

I tried to install the latest (0.54) version with the later contributed newsletter.php file.

 

Using the product_notification module I get the following error:

Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /oscommerce/admin/includes/modules/newsletters/product_notification.php on line 272

 

Using the newsletter module I get the following error:

Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /oscommerce/admin/includes/modules/newsletters/newsletter.php on line 130

 

Can someone please post a workin newsletters.php for the admin?

I don't get the error.

I saw that people had the same or an equivalent error.

Did you guys solve that?

 

Please help.

 

poschiman

Edited by poschiman
Link to comment
Share on other sites

I tried to install the latest (0.54) version with the later contributed newsletter.php file.

 

Using the product_notification module I get the following error:

Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /oscommerce/admin/includes/modules/newsletters/product_notification.php on line 272

 

Using the newsletter module I get the following error:

Parse error: parse error, unexpected ';', expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /oscommerce/admin/includes/modules/newsletters/newsletter.php on line 130

 

Can someone please post a workin newsletters.php for the admin?

I don't get the error.

I saw that people had the same or an equivalent error.

Did you guys solve that?

 

Please help.

 

poschiman

 

 

Parse error is normally caused by a missing tag such as ' " ; } when you copied the code you likely missed something.

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

  • 2 weeks later...

Hi there

 

I'm considering using this to merge a previous mailing list with the one now maintained by OsC .

 

Is it possible to take a number of email addresses and enter them into this contribution so that the newsletter emails them too?

 

Thanks

===============

Simple yet Creative

Get Online Web Design : getonlinedesign.com

===============

Link to comment
Share on other sites

PLEASE HELP:

 

I'm ready to give up on this contribution!. I have installed it on a heavily modifed osc shop. From the frontend it all works great, until I go to the backend, and try to send a newsletter.

 

I have installed a WYSIWYG editor (WYSIWYG HTMLArea MS2 v1.7 to be precise) it works and I just created my html newsletter, previewed it, looks good.

 

Just before I click send I get the following error shown above my preview of the html newletter I created;

 

Warning: Missing argument 3 for newsletter_subscribers() in /web1/users/u3497/docs/catalog/admin/includes/modules/newsletters/newsletter_subscribers.php on line 17

 

Warning: Missing argument 4 for newsletter_subscribers() in /web1/users/u3497/docs/catalog/admin/includes/modules/newsletters/newsletter_subscribers.php on line 17

 

Warning: Missing argument 5 for newsletter_subscribers() in /web1/users/u3497/docs/catalog/admin/includes/modules/newsletters/newsletter_subscribers.php on line 17

 

Warning: Missing argument 6 for newsletter_subscribers() in /web1/users/u3497/docs/catalog/admin/includes/modules/newsletters/newsletter_subscribers.php on line 17

 

Warning: Missing argument 7 for newsletter_subscribers() in /web1/users/u3497/docs/catalog/admin/includes/modules/newsletters/newsletter_subscribers.php on line 17

 

 

----- then when I click send I get the following errors;----

 

 

Warning: Missing argument 3 for newsletter_subscribers() in /web1/users/u3497/docs/catalog/admin/includes/modules/newsletters/newsletter_subscribers.php on line 17

 

Warning: Missing argument 4 for newsletter_subscribers() in /web1/users/u3497/docs/catalog/admin/includes/modules/newsletters/newsletter_subscribers.php on line 17

 

Warning: Missing argument 5 for newsletter_subscribers() in /web1/users/u3497/docs/catalog/admin/includes/modules/newsletters/newsletter_subscribers.php on line 17

 

Warning: Missing argument 6 for newsletter_subscribers() in /web1/users/u3497/docs/catalog/admin/includes/modules/newsletters/newsletter_subscribers.php on line 17

 

Warning: Missing argument 7 for newsletter_subscribers() in /web1/users/u3497/docs/catalog/admin/includes/modules/newsletters/newsletter_subscribers.php on line 17

 

 

-- the newsletter arrives in my test email account, and all I see is the unsubribed link from the footer section of the newsletter. none of my nice clean html output that i spent hours putting together.

 

anyone got any suggestions, i've spent nearly two hours going thru this thread looking for answers and now i'm REALLY confused!!!!!!

Link to comment
Share on other sites

I'm assisting a client in setting up his online store using OSC, one of his requirements is to feature a Newsletter sign up form for non-customers to opt in to receive product updates and tips.

 

Looking through the limited collections of contributions for this purpose, I figure this is probably the more promising one, but then again I looked through the threads of forum post on this contribution, I thought I saw more heartaches then joys, it makes me think twice if I should go ahead and do the modification since the mod looks rather heavy to me, I dont want to spend time and get trouble in the end.

 

So I'm hoping someone here, who had successfully integrated this contribution to his OSC, are able to show me his/her site for me to see how it works (just frontend will do), I really need to very sure of this before I go ahead, or decide if I should just suggest the client to use one of the external newsletter sites.

 

Appreciate your help in advance.

Link to comment
Share on other sites

After many hours I got this to work, not the way it should but at least it is now sending mails

 

however, I have one problem. when I send a mail (html) I get huge spaces appearing between tables and elements etc, yet in admin preview I get it looking fine, without any problems.

 

I have checked the source code of the emails sent out and many extra <br> tags are being added. I have the fix for this already in my admin/classes/email.php file, but it doesn't seem to have fixed the problem.

 

Can anyone suggest anything else?????

Link to comment
Share on other sites

  • 2 weeks later...

few question about this contribuition and, in general, about newsletter/product notification:

 

i dont really need non-user to subscribe to my newsletter, but i want to be able to see in any moment a list of those user subscripted, and eventually act on this list.

 

now i see is possible to enable user or disable then for newletter. but once i update the usrlist, all my action are lost.

also. there is only a list of NEWLETTER subscriber, but there is no way to know who is subscribed to prodduct's notification.

 

is there anything to know which user is subscribed to a certain product's notification?

thanks

jacopo from shangahi

Expresionario.com | Pura Sub-cultura!

Link to comment
Share on other sites

just installed, and everything looks ok, no errors on any page.

 

When I create a newsletter I am offered three options.

 

Newsletter

Newsletter_Subscribers

Product Notifications.

 

I have sent a test to both newsletter and newsletter subscribers, but on both occasions the newsletter manager displays the newsletter with a large red X next to sent.

 

Any clues as to why, again no errors appear on anything with regards the newsletters, only this red X, and I do not receive the test.

Born - Scotland

Location - Kent, England

Job - hunting for one

Link to comment
Share on other sites

Hi,

 

I just installed this. I get the following error when i load the page: admin/newsletters.php

 

1146 - Table 'osherbal.newsletters' doesn't exist

select count(*) as total from newsletters

[TEP STOP]

 

When I look in the file - it calls for the old newsletters table 13 times.

 

Also there is no such file as: admin/includes/modules/newsletters/newsletters.php there is a admin/includes/modules/newsletters/newsletter.php - is that correct? Same in the language part.

 

Can anyone help me?

 

Thanks,

Philip

Edited by dwdonline
Link to comment
Share on other sites

I've installed this contribution only yesterday, and I've already many spammers as newsletter subscribers.

I can see them (spammers) in subscribers admin.

How can I do to stop fraud subscriptions?

Is there a control for subscriptions?

What's "blacklist" in subscribers admin?

Skype: centoasa

Skype: remigioruberto

Link to comment
Share on other sites

Many more spammers subscribe to my newsletter!

Is it possible a confirm to subscription by email, or simply on website?

Thank's

 

 

The contribution currently does not support that. It really needs an overhaul but no one besides a couple of people seem interested in helping develop it.

Most Valuable OsCommerce Contributions:

Also Purchased (AP) Preselection (cuts this resource hogging query down to nothing) -- Contribution 3294

FedEx Automated Labels -- Contribution 2244

RMA Returns system -- Contribution 1136

Sort Products By Dropdown -- Contribution 4312

Ultimate SEO URLs -- Contribution 2823

Credit Class & Gift Voucher -- Contribution 282

Cross-Sell -- Contribution 5347

Link to comment
Share on other sites

I've instelled release 053.

I've found newsletter.php on catalog root: what's the use of this file, if it's don't be called from any other files? When guest subscribe to my newsletter, fill the field name and email, and pressing go button go directly to /newsletters_subscribe_success.php page. It's right?

Please, try to www.100asa.it

Skype: centoasa

Skype: remigioruberto

Link to comment
Share on other sites

Ok - this has been asked time after time - but it seams to just is always looked over. The problem that causes this error:

 

1146 - Table 'osherbal.newsletters' doesn't exist

select count(*) as total from newsletters

[TEP STOP]

 

Replace the 11 places of:

 

TABLE_NEWSLETTERS

 

with:

TABLE_SUBSCRIBERS_UPDATE

 

Thanks,

Philip

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...