Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Newsletter products, HTML email


scottyb

Recommended Posts

Got it to work by putting the define in application_top.php...

 

Having problems trying to get it to work with MaxiDVD images mod, how would i get it to rip the imagecache images instead of the original images?

 

Also, the links being generated on the images are linking to my admin site instead of the catalog site, how would i change that?

 

Thanks, great mod!

 

Hi all, with regard to the wrong link being produced and the wrong images being displayed, this bit of code seems to be responsible for controlling those two things, lines 152 and 153 from admin/includes.modules/newsletters/newsletter_products.php:

 

<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $this->productsInfo[$i]['products_id']) . '" style="' . $cssLink . '">' . tep_image(HTTP_CATALOG_SERVER_EMAIL . DIR_WS_CATALOG_IMAGES_EMAIL . $this->productsInfo[$i]['products_image'], $this->productsInfo[$i]['products_name'], 150) . '<br>' . $this->productsInfo[$i]['products_name'] . '</a>

 

The link that gets generated is one that points to the admin site instead of the catalog which must be caused by tep_href_link so i'd like to be able to substitute that link with a new define in configure.php which points to my catalog site, its called HTTP_CATALOG_SERVER_EMAIL. How would i rewrite the above bit of code to use this variable instead of tep_href_link ?

 

Also, with regard to the images, how would i get it to pull the MaxiDVD imagecache thumbnail images instead of the BIG images which get scaled down the old oscommerce way?

 

Thanks for any help...

Link to comment
Share on other sites

  • Replies 268
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Another problem im facing with this mod is editing the text content and title of a newsletter. When ive already entered the title and text content of a newletter and hit save, everything seems fine. But when i try to edit the newsletter again, the title is blank and the text content is blank so that ive to enter it in all over again, why is it not retrieving the info i entered in already?

 

Thanks.

Link to comment
Share on other sites

  • 1 month later...

Hi,

Just installed version 2.3. Everything seems to be working fine, creating a newsletter, previewing it etc.. but when I try to send it, this is what I get:

 

========

Warning: reset() [function.reset]: Passed variable is not an array or object in /home4/vyxncleu/public_html/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home4/vyxncleu/public_html/admin/includes/classes/object_info.php on line 18

 

Warning: main(includes/languages/polish/modules/newsletters/.php) [function.main]: failed to open stream: No such file or directory in /home4/vyxncleu/public_html/admin/newsletters.php on line 398

 

Warning: main(includes/languages/polish/modules/newsletters/.php) [function.main]: failed to open stream: No such file or directory in /home4/vyxncleu/public_html/admin/newsletters.php on line 398

 

Warning: main(includes/languages/polish/modules/newsletters/.php) [function.main]: failed to open stream: No such file or directory in /home4/vyxncleu/public_html/admin/newsletters.php on line 398

 

Warning: main() [function.include]: Failed opening 'includes/languages/polish/modules/newsletters/.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home4/vyxncleu/public_html/admin/newsletters.php on line 398

 

Warning: main(includes/modules/newsletters/.php) [function.main]: failed to open stream: No such file or directory in /home4/vyxncleu/public_html/admin/newsletters.php on line 399

 

Warning: main(includes/modules/newsletters/.php) [function.main]: failed to open stream: No such file or directory in /home4/vyxncleu/public_html/admin/newsletters.php on line 399

 

Warning: main(includes/modules/newsletters/.php) [function.main]: failed to open stream: No such file or directory in /home4/vyxncleu/public_html/admin/newsletters.php on line 399

 

Warning: main() [function.include]: Failed opening 'includes/modules/newsletters/.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home4/vyxncleu/public_html/admin/newsletters.php on line 399

 

Fatal error: Cannot instantiate non-existent class: in /home4/vyxncleu/public_html/admin/newsletters.php on line 405

 

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

 

Please advise what to do. Thanks -- ania

Link to comment
Share on other sites

  • 2 weeks later...

Ok so just installed this much needed contrib. THANKS!!!!

So everything works, preview and all and looks good. But when I send it stays on the

 

Please wait .. sending emails ..

 

Please do not interrupt this process!

 

It is not sending the e-mails? Is there something I need to check with my hosting company?

 

Thanks in advance

Link to comment
Share on other sites

  • 2 months later...

Hi there,

 

I've installed version 2.3 and everything is working fine except that it doesn't make my images smaller by using SMALL_IMAGE_WIDTH and SMALL_IMAGE_HEIGHT. In the Admin I've configured the SMALL_IMAGE_WIDTH to '100' and SMALL_IMAGE_HEIGHT to nothing. In the catalog on product_info.php for example the image is perfectly resizing. The width stays at 100 pixels and it's calculating itself how much the height must be.

 

But newsletter_products.php doens't work like that it seems. It's showing the original size of the images and because my original images are mostley 400 to 600 pixels wide, I got a use email sent to my customers.

 

I can't set the image width and height to a standard size because the pictures of my products do have different sizes. So when I set the width and height to say 100 and 200pixels, the images won't be in their proportions anymore.

 

Can anyone tell me how to fix this problem?

 

Kind regards,

 

Marcus

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

Hello

 

I got a problem, the problem is that I got this fail everytime in admin: Error: Newsletter module required

 

I have choose Newsletter_produckts and I got this fail someone who know what this is?

 

Thanks for any help:)

Link to comment
Share on other sites

  • 1 month later...

Hi. I installed the contribution 2.3 but I cannot see anything in admin section. I checked it many times but I can't find what I forget. What am I doing wrong?

 

I found it....I wasn't looking to the right place!!!!

Edited by mkam
Link to comment
Share on other sites

htacces protects the newsletter from being read by my customers, due to the fact that my admin section is pasword protected with a htacces.

This means that my customers won't see any newsletter until they have the right pasword!!

Probably because the template is in the admin section...............

 

Anyone ideas to solve this???

Thanks

Edited by abdllatif
Link to comment
Share on other sites

htacces protects the newsletter from being read by my customers, due to the fact that my admin section is pasword protected with a htacces.

This means that my customers won't see any newsletter until they have the right pasword!!

Probably because the template is in the admin section...............

 

Anyone ideas to solve this???

Thanks

The problem has been solved, you don't put the image files in the same folder as the template, since the admin section is most of the time htacces protected! If you put the imagefiles of your new template in the folder .../catalog/images there is no prolem at all.

Nice contribution, thank you.................!!

Link to comment
Share on other sites

  • 1 month later...

Everything seems to be working here now since i changed the links generated and added new catalog links to configure.php especially for the newsletter mod (i'd say this only affects shared SSL accounts).

 

Some additions to this mod that i would love to see (as would many others im sure):

 

1. It would be excellent to be able to select which customers you want to send the newsletter to instead of the current "send to all customers or none" option. This way, you could tailor make newsletters based on a customers needs and send them instant info on certain products they are looking for. This would save many people the hassle of emailing certain product info to individual customers and having to copy/paste info and images into an email. This is a BIG deal for a lot of companies ive done osC sites for and having this option in the newsletter mod would be a huge time saver...

The only way around this currently is to preview a newsletter, view the source code and copy everything between <HTML> </HTML> and past this into Outlook Express to send from there, which works really well but its too fiddly for the average client...

 

2. Having the ability to add a certan amount of the product description to each product in the newsletter. This is one option that should have been there from the start! How many newsletters do you see from companies that just have the image, product name and price? None... They all have descriptions as well. This seems to be a fairly important feature to have on any newsletter mod.

 

Other than those two things, this is such an excellent mod, its the one mod ive come across that most companies are interested in getting! Thanks to the developers for this one! :)

Edited by sonictrip.net
Link to comment
Share on other sites

Oh man, dunno what im doing wrong on this site... I've installed this mod on 2 other sites and got them to work but im trying to install on another site and everything seems fine except the preview just shows a blank page?? What could be causing this? If i even just knew where to look i might be able to figure it out... thanks!

Link to comment
Share on other sites

Forget about the last post, i remembered i had modified html_output with a new tep_email_href_link function to accomodate my path names to my Catalog folder and for MaxiDVD coz on a shared server it didnt seem to be working too well and using Admin links instead; it would show everything fine except with the product name appearing twice on top of each other and no product image.

 

I modified admin/includes/functions/html_output and added the following above the HTML image wrapper function:

 

//newsletter mod for CATALOG link instead of ADMIN link:
 function tep_email_href_link($page = '', $parameters = '', $connection = 'NONSSL') {
if ($connection == 'NONSSL') {
  $link = HTTP_CATALOG_SERVER_EMAIL;

} else {
  die('</td></tr></table></td></tr></table><br><br><font color="#ff0000"><b>Error!</b></font><br><br><b>Unable to determine connection method on a link!<br><br>Known methods: NONSSL SSL<br><br>Function used:<br><br>tep_href_link(\'' . $page . '\', \'' . $parameters . '\', \'' . $connection . '\')</b>');
}
if ($parameters == '') {
  $link .= $page;
} else {
  $link .= $page . '?' . $parameters;
}

while ( (substr($link, -1) == '&') || (substr($link, -1) == '?') ) $link = substr($link, 0, -1);

return $link;
 }
////

 

 

Then i added the following two lines to admin/includes/configure.php:

 

 

define('HTTP_CATALOG_SERVER_EMAIL', 'http://www.website.ie/catalog/');
define('DIR_WS_CATALOG_IMAGES_EMAIL', 'images/');

 

 

Then i replaced this bit of code in admin/includes/modules/newsletters/newsletter_products.php:

 

 

$html_content .= '</tr><tr><td align="center" width="' . $width . '%"><a href="' . tep_catalog_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $this->productsInfo[$i]['products_id']) . '" style="' . $cssLink . '">' . tep_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES . $this->productsInfo[$i]['products_image'], $this->productsInfo[$i]['products_name']) . '<br>' . $this->productsInfo[$i]['products_name'] . '</a><br>';
			$price = ($this->productsInfo[$i]['specials_price']) ? '<span style="'. $cssMarkdown . '">' . $currencies->display_price($this->productsInfo[$i]['products_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) . '</span>  <span style="' . $cssSale . '">' . $currencies->display_price($this->productsInfo[$i]['specials_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) . '</span>' : '<span style="' . $cssPrice . '">' . $currencies->display_price($this->productsInfo[$i]['products_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) . '</span>';
			$html_content .= $price . '</td>';
			$col = 0;
		}else{
			$html_content .= '<td align="center" width="' . $width . '%"><a href="' . tep_catalog_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $this->productsInfo[$i]['products_id']) . '" style="' . $cssLink . '">' . tep_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES . $this->productsInfo[$i]['products_image'], $this->productsInfo[$i]['products_name']) . '<br>' . $this->productsInfo[$i]['products_name'] . '</a><br>';
			$price = ($this->productsInfo[$i]['specials_price']) ? '<span style="' . $cssMarkdown . '">' . $currencies->display_price($this->productsInfo[$i]['products_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) . '</span>  <span style="' . $cssSale . '">' . $currencies->display_price($this->productsInfo[$i]['specials_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) . '</span>' : '<span style="' . $cssPrice . '">' . $currencies->display_price($this->productsInfo[$i]['products_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) . '</span>';
			$html_content .= $price . '</td>';

 

 

with this bit of code:

 

 

$html_content .= '</tr><tr><td align="center" valign="bottom" width="' . $width . '%" bgcolor="#ffffff" height="150"><a href="' . tep_email_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $this->productsInfo[$i]['products_id']) . '" style="' . $cssLink . '"><span style"' . $cssImage . '">' . tep_image(HTTP_CATALOG_SERVER_EMAIL . DIR_WS_CATALOG_IMAGES_EMAIL . $this->productsInfo[$i]['products_image'], $this->productsInfo[$i]['products_name'], 120) . '</span><br>' . $this->productsInfo[$i]['products_name'] . '</a><br>';
			$price = ($this->productsInfo[$i]['specials_price']) ? '<span style="'. $cssMarkdown . '">' . $currencies->display_price($this->productsInfo[$i]['products_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) . '</span>  <span style="' . $cssSale . '">' . $currencies->display_price($this->productsInfo[$i]['specials_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) . '</span>' : '<span style="' . $cssPrice . '">' . $currencies->display_price($this->productsInfo[$i]['products_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) . '</span>';
			$html_content .= $price . '</td>';
			$col = 0;
		}else{
			$html_content .= '<td align="center" valign="bottom" width="' . $width . '%" bgcolor="#ffffff" height="150"><a href="' . tep_email_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $this->productsInfo[$i]['products_id']) . '" style="' . $cssLink . '">' . tep_image(HTTP_CATALOG_SERVER_EMAIL . DIR_WS_CATALOG_IMAGES_EMAIL . $this->productsInfo[$i]['products_image'], $this->productsInfo[$i]['products_name'], 120) . '<br>' . $this->productsInfo[$i]['products_name'] . '</a><br>';
			$price = ($this->productsInfo[$i]['specials_price']) ? '<span style="' . $cssMarkdown . '">' . $currencies->display_price($this->productsInfo[$i]['products_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) . '</span>  <span style="' . $cssSale . '">' . $currencies->display_price($this->productsInfo[$i]['specials_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) . '</span>' : '<span style="' . $cssPrice . '">' . $currencies->display_price($this->productsInfo[$i]['products_price'], tep_get_tax_rate($this->productsInfo[$i]['products_tax_class_id'])) . '</span>';
			$html_content .= $price . '</td>';

 

 

It's working great and although it shows scaled down original images in the admin preview, in the received email you can see crystal clear images scaled properly by the image resizer which is part of MaxiDVD. Maybe this is a solution to the problems people have been having with the MaxiDVD mod, which, by the way, is excellent!

Edited by sonictrip.net
Link to comment
Share on other sites

The problem im now facing is trying to get a limited amount of characters of the product description to display beside the product name, image and price in the newsletter.

 

Has anyone figured out a way to do this and if so would they mind sharing the code please? Thanks! :)

Link to comment
Share on other sites

  • 1 month later...

Hi Scottyb

Thank you for great contribution but please why I have twwo times price? Please where I can change it, you can see how it works on images:

old price EUR [old price in SKK] special price EUR [special price in SKK] special price EUR [special price in SKK] / special price EUR [special price in SKK]

 

I want only old price EUR [old price in SKK] special pice EUR [special price in SKK]

here is picture:

newsletter.jpg

 

Thank you for help

Link to comment
Share on other sites

  • 1 month later...

Great contribution. Thanks. I am receiving the below Warning though for a file that had no modifications:

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home2/doubled1/public_html/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home2/doubled1/public_html/admin/includes/classes/object_info.php on line 18

 

Do you know what the ???

 

Appreciate your help.

Link to comment
Share on other sites

  • 1 month later...
Hi Scottyb

Thank you for great contribution but please why I have twwo times price? Please where I can change it, you can see how it works on images:

old price EUR [old price in SKK] special price EUR [special price in SKK] special price EUR [special price in SKK] / special price EUR [special price in SKK]

 

I want only old price EUR [old price in SKK] special pice EUR [special price in SKK]

here is picture:

newsletter.jpg

 

Thank you for help

 

It works for me fine. Check the installation again.

Link to comment
Share on other sites

  • 2 weeks later...

Hello everyone!

 

I just installed v.3.0....but when i try to save my new newsletter I get this error message:

 

Error: Newsletter module required

 

What is wrong here now? Somebody please help :(

Link to comment
Share on other sites

Hello everyone!

 

I just installed v.3.0....but when i try to save my new newsletter I get this error message:

 

Error: Newsletter module required

 

What is wrong here now? Somebody please help :(

 

Some more error messages?

 

Check your installation again.

Edited by kornel76
Link to comment
Share on other sites

  • 3 weeks later...
Great contribution. Thanks. I am receiving the below Warning though for a file that had no modifications:

 

Warning: reset() [function.reset]: Passed variable is not an array or object in /home2/doubled1/public_html/admin/includes/classes/object_info.php on line 17

 

Warning: Variable passed to each() is not an array or object in /home2/doubled1/public_html/admin/includes/classes/object_info.php on line 18

 

Do you know what the ???

 

Appreciate your help.

 

Hi,

 

I have the same problem, If I want to edit a newsletter created before.

 

Szia Kornél,

 

Nagyon jó a kiegészítés, grat. Egy problémám akadt: a fenti hibaüzenetet kapom, amikor egy létrehozott hírlevelet akarok szerkeszteni.

Valamit rosszul installáltam?

 

Előre is köszi,

 

Üdv,

 

HF

Link to comment
Share on other sites

Hello everyone!

 

I just installed v.3.0....but when i try to save my new newsletter I get this error message:

 

Error: Newsletter module required

 

What is wrong here now? Somebody please help sad.gif

 

I have tested on a stock v2.2 RC2 installation. The same result.

 

You can comment out:

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

Than it will work.

Edited by kornel76
Link to comment
Share on other sites

Hi,

 

I have the same problem, If I want to edit a newsletter created before.

 

Szia Kornél,

 

Nagyon jó a kiegészítés, grat. Egy problémám akadt: a fenti hibaüzenetet kapom, amikor egy létrehozott hírlevelet akarok szerkeszteni.

Valamit rosszul installáltam?

 

Előre is köszi,

 

Üdv,

 

HF

I cannot reproduce the problem. It works for me with a stock v2.2 RC2 and with my modified MS2, also with newsletter created before.

If you have v2.2 RC2, you need, just some lines to comment out. (Read above!)

 

 

Szia.

Gőzöm sincs mi lehet az oka, mivel nem tudom előídézni ezt a hibát. Úgy érted, hogy a telepítés előtt készült hírlevelet nem tudod szerkeszteni?

Üdv.

 

Kornél

Link to comment
Share on other sites

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