Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Newsletter products, HTML email


scottyb

Recommended Posts

Not to be outdone by milerwan, the official Version 2.0 (that I have promised long ago) is released.

 

B.K. & Kristian (don't know his username) got a sneak peak last week - I'm hoping no news is good news.

 

This release fixes the obvious issues stated here, adds specials, adds multipart-text/html email version to help lower spam scoring. Overall, this release is more in-tune with the osCommerce standard of coding.

 

Enjoy

 

 

I get this error when i save the newsletter:

 

1054 - Unknown column 'newsletters_id' in 'field list'

insert into newsletters_to_products (newsletters_id, products_id) values (1, 53)

 

 

I thought it would be an error in the sql for creating the table?

 

So i changed it to this: (newsletter_id => newsletters_id)

ALTER TABLE newsletters ADD template varchar(64) AFTER locked;
CREATE TABLE `newsletters_to_products` (
`newsletters_id` INT( 11 ) DEFAULT '0' NOT NULL ,
`products_id` INT( 11 ) DEFAULT '0' NOT NULL ,
PRIMARY KEY ( `newsletter_id` , `products_id` )
);

 

 

But then i get an error when previewing a saved newsletter:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and pd.language_id=1' at line 1

select p.products_id, pd.products_name, p.products_image2, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from products p, products_description pd left join specials s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in() and pd.language_id=1

 

 

 

EDIT: also the readme is missing instructions for editing database_tables.php

 

ADD:

  //newsletter products
 define('TABLE_NEWSLETTERS_TO_PRODUCTS', 'newsletters_to_products');
 //end newsletter products

Edited by ShadowMoses
Link to comment
Share on other sites

  • Replies 268
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

I get this error when i save the newsletter:

 

1054 - Unknown column 'newsletters_id' in 'field list'

insert into newsletters_to_products (newsletters_id, products_id) values (1, 53)

 

So i changed it to this: (newsletter_id => newsletters_id)

ALTER TABLE newsletters ADD template varchar(64) AFTER locked;
CREATE TABLE `newsletters_to_products` (
`newsletters_id` INT( 11 ) DEFAULT '0' NOT NULL ,
`products_id` INT( 11 ) DEFAULT '0' NOT NULL ,
PRIMARY KEY ( `newsletter_id` , `products_id` )
);

 

ADD:

  //newsletter products
 define('TABLE_NEWSLETTERS_TO_PRODUCTS', 'newsletters_to_products');
 //end newsletter products

 

Thanks for pointing out the error in the sql file. I think that the preview error is a result of the initial error.

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and pd.language_id=1' at line 1

select p.products_id, pd.products_name, p.products_image2, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from products p, products_description pd left join specials s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in() and pd.language_id=1

 

Notice that your "in()" statement in the sql is empty. Delete the newsletter or manually put the (1, 53) values into your newsletters_to_products and it should work.

Link to comment
Share on other sites

Notice that your "in()" statement in the sql is empty. Delete the newsletter or manually put the (1, 53) values into your newsletters_to_products and it should work.

 

Almost! i get a new error now:

 

1054 - Unknown column 'p.products_image2' in 'field list'

select p.products_id, pd.products_name, p.products_image2, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from products p, products_description pd left join specials s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in(53) and pd.language_id=1

 

Does it take into account some multi image contribution?

 

 

any idea on error

 

Error!

 

Unable to determine the page link!

 

Function used:

 

tep_href_link('', '', 'NONSSL')

 

in newsletter.php?

 

Did you modify newsletter.php or overwrite with the one in the package?

At first i modified it but i got an error (i forget what it was now) so, seeing as i hadn't changed anything in it before, i just overwrote it and it worked.

Link to comment
Share on other sites

Hi and sorry for my late answer.

 

- I had the same problems described above. indeed, a ligne is missing in the database file that define the newsletters_to_products file.

 

- Also care of p.products_image2 (normally p.products_image) !

 

- rename newsletter_id by newsletters_id in the newsletters_to_products database.

 

I still haven't manage to join the content of my newsletter with my template in the preview step, I've got only the product. I'm woking on it.

 

Special prices are present, it's great.

 

See you

Link to comment
Share on other sites

- Also care of p.products_image2 (normally p.products_image) !

 

Cool, i changed that... and now get another error :)

 

1054 - Unknown column 'p.products_id' in 'on clause'

select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from products p, products_description pd left join specials s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in(53) and pd.language_id=1

Link to comment
Share on other sites

HOUSTON, I need help!!!

 

any idea of this error?:

 

Error!

 

Unable to determine the page link!

 

Function used:

 

tep_href_link('', '', 'NONSSL')

 

in newsletter.php?

 

Thanks for every thing...

Link to comment
Share on other sites

HOUSTON, I need help!!!

 

any idea of this error?:

 

Error!

 

Unable to determine the page link!

 

Function used:

 

tep_href_link('', '', 'NONSSL')

 

in newsletter.php?

 

Thanks for every thing...

 

 

 

Yes everyone having this error I found where the problem is. :thumbsup:

 

It's in admin/includes/languages/english/modules/newsletters/newsletter_products.php

 

Comment out "//" or change this line:

 

 

//define('TEXT_UNSUBSCRIBE', "\n\n" . 'You are receiving this notice because you have subscribed to our newsletter. To unsubscribe:' ."\n". HTTP_SERVER . DIR_WS_CATALOG . 'newsletters_unsubscribe.php?action=view&email=');

 

 

error is in the code needs to be fixed.

 

bless

culturebee

Link to comment
Share on other sites

Got rid of the first error with database_table define, now seeing another:

 

1054 - Unknown column 'newsletters_id' in 'where clause'

 

select products_id from newsletters_to_products where newsletters_id = '2'

 

[TEP STOP]

 

thanks for any help :)

 

and the fix for error

 

1054 - Unknown column 'newsletters_id' in 'field list'

 

insert into newsletters_to_products (newsletters_id, products_id) values (2, 544)

 

[TEP STOP]

 

 

is?

Link to comment
Share on other sites

OK,

 

You can try

 

define('TEXT_UNSUBSCRIBE', '' ."\n\n" . 'You are receiving this notice because you have subscribed to our newsletter. To unsubscribe:' ."\n". HTTP_SERVER . DIR_WS_CATALOG . 'newsletters_unsubscribe.php?action=view&email=');

 

 

 

 

k

Link to comment
Share on other sites

I get the following sql error. Does anyone have a solution? :)

The problem occurs using MySQL 5, version 4 doesn't give any errors.

 1054 - Unknown column 'p.products_id' in 'on clause' 

select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from products p, products_description pd left join specials s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in(738,990,938,855,175,353,1059,1043,874,895,884,749,350) and pd.language_id=1

[TEP STOP]

 

 

If you use MYSQL 5 just change the first comma before the the left join into inner join !

 

select p.products_id, pd.products_name, p.products_image2, p.products_price, p.products_tax_class_id, if(s.status, s.specials_new_products_price, NULL) as specials_price from products p INNER JOIN products_description pd left join specials s on p.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in(99, 100, 101, 102) and pd.language_id=2

Edited by Scotty2k
Link to comment
Share on other sites

Just installed this contribution but getting error mesage:

 

 

Catchable fatal error: Object of class newsletter_products could not be converted to string in catalog\admin\includes\functions\html_output.php on line 281

 

Can someone help?

 

Line 281 in here some where:

// Output a form hidden field
function tep_draw_hidden_field($name, $value = '', $parameters = '') {
$field = '<input type="hidden" name="' . tep_output_string($name) . '"';

if (tep_not_null($value)) {
$field .= ' value="' . tep_output_string($value) . '"';
} elseif (isset($GLOBALS[$name]) && is_string($GLOBALS[$name])) {
$field .= ' value="' . tep_output_string(stripslashes($GLOBALS[$name])) . '"';
}

if (tep_not_null($parameters)) $field .= ' ' . $parameters;

$field .= '>';

return $field;
}

////
// Output a form pull down menu
function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
$field = '<select name="' . tep_output_string($name) . '"';

if (tep_not_null($parameters)) $field .= ' ' . $parameters;

$field .= '>';

Link to comment
Share on other sites

  • 2 weeks later...

In local the contribution looks work fine.

But when i upload it, get error:

 

Catchable fatal error: Object of class newsletter_products could not be converted to string in catalog\admin\includes\functions\html_output.php on line 282

 

sorry for my english, im from argentina

Link to comment
Share on other sites

I cant edit my previous post.

 

Line 282 of my html_output.php:

 

if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

 

I already Change the function in admin/includes/modules/newsletters/newsletter_products.php suggested for melhaa in post #100, but nothing happen, everything follows equal.

Link to comment
Share on other sites

OK... reading about another contribution (Dynamic Sitemap; http://www.oscommerce.com/forums/index.php?sho...ror&st=480; post #496) i find what "CraXyOW3" say something about the "Catchable..." problem

 

Ok, first time i checked the BUGS section of oscommerce's site and i found my problem ! biggrin.gif now it works nicely so far!

 

change the

if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

 

to

if ( ($default == '' && $GLOBALS[$name] == $values[$i]['id']) || ($default == $values[$i]['id']) );

 

I didit and now i see the pull down menu with product list, but when i select some products with ">>> button", they not show in the right panel. Internet explorer 7, show me an page error (in the left of state bar):

'document.newsletter.elements.products[].length' he is null or it is not an object

 

And if i "save" the newsletter, tellme "Error: Newsletter module required".

Link to comment
Share on other sites

NOW WORKS FINE:

Solucion to Catchable fatal error:

 

Using the original files of contribution, only do this changes:

 

In html_output.php

 

change the

if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

to

if ( ($default == '' && $GLOBALS[$name] == $values[$i]['id']) || ($default == $values[$i]['id']) );

 

If you obtain "Error: Newsletter module required" when tray to save newsletter; go to admin/newsletters.php,

find

if (empty($module)) {
	  $messageStack->add(ERROR_NEWSLETTER_MODULE, 'error');
	  $newsletter_error = true;
	}

 

and comment it

/* if (empty($module)) {
	  $messageStack->add(ERROR_NEWSLETTER_MODULE, 'error');
	  $newsletter_error = true;
	} */

Link to comment
Share on other sites

Hi

 

Can any1 please help a me with the creation of the html document, I just started to learn the basics of osCommerce 3 weeks ago....

Link to comment
Share on other sites

Hi all,

 

Please help me as I failed to send html newletter and emails yet.

 

please advise me way to send HTML Newsletter and Html Email. What i did previously which failed, I created HTML Page for newsletter in dreamweaver and Copied code in NEWSLETTER manager in OSCommerce admin section. It showed me page in a way I created in preview.

When I locked it and sent it, in customer email it all comes up in a HTML code not as a proper Html newsletter.

 

there are several contribution with different comments on it which are making me confuse.

I will be very gratefull for any one give me right direction/advise or best working contribution link.

Following is my current setting which sends normal (default) emails without any problem.

 

 

E-Mail Transport Method smtp

E-Mail Linefeeds LF

Use MIME HTML When Sending Emails true

Verify E-Mail Addresses Through DNS false

Send E-Mails true

 

I prefer using Dreamweaver to create html newsletter, please advise me to enable sending html newsletter from my website.

Someone said that Email setting for html in "config-- Admin--" not always work, which code and which file I have to edit , please specify.

 

Thanks and regards.

 

zee

Edited by zeeshop
Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

I have installed this contri and i don't get any errors, but i also don't get to see the products.

My preview is empty only the text is visable but no products.

What i'm missing.

 

I've installed it several times. I must say i have also installed "newsletters contri V050".

 

can someone please help me.

 

Sorry, for my bad english, i'm Dutch.

 

Thnx.

Link to comment
Share on other sites

  • 2 weeks later...

Hi could some one help

 

I installed newsletter 2.0 posted on ( 22 May 2007) but having this problem

 

 

Unable to determine the page link!

 

Function used:

 

tep_href_link('', '', 'NONSSL')

 

 

could some one help.

 

Thanks

Ajay.

Link to comment
Share on other sites

  • 3 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...