Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Newsletter products, HTML email


scottyb

Recommended Posts

  • Replies 268
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Is there possible way to send a test of a newsletter to only one email address before sending it out in bulk?

 

use phpmyadmin to change the customer_newsletter field to 2 for every customer that has a customer_newsletter = 1.

 

UPDATE customers SET customers_newsletter = '2' where customers_newsletter = '1'

 

Make an account for yourself in your shop admin and set it to receive the newsletter - test away.

 

After your testing is complete, you can change your customer newsletter subscriptions back by using the following query.

UPDATE customers SET customers_newsletter = '1' where customers_newsletter = '2'

Link to comment
Share on other sites

I've got the same problem. How did you resolve this? I can't even find the code you quoted in your post.. In which file is it located?

 

All working!

 

Except that there is no images at all.

 

I tried modifing configure.php with diferent solutions of this thread:

  define('DIR_WS_CATALOG_IMAGES_O', DIR_WS_CATALOG .'images/');
 define('HTTP_CATALOG_SERVER_EMAIL', 'http://www.myweb.com/');
 define('DIR_WS_CATALOG_IMAGES_EMAIL', 'images/');

 

				$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_newsletter(HTTP_CATALOG_SERVER_EMAIL . DIR_WS_CATALOG_IMAGES_EMAIL . $this->productsInfo[$i]['products_image'], $this->productsInfo[$i]['products_name'], 92, 92) . '<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_newsletter(HTTP_CATALOG_SERVER_EMAIL . DIR_WS_CATALOG_IMAGES_EMAIL . $this->productsInfo[$i]['products_image'], $this->productsInfo[$i]['products_name'], 92, 92) . '<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>';
		}

 

also this one.

 

 

				$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_newsletter(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES_O . $this->productsInfo[$i]['products_image'], $this->productsInfo[$i]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<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_newsletter(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES_O . $this->productsInfo[$i]['products_image'], $this->productsInfo[$i]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '<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>';

 

 

 

 

 

 

 

 

 

I dont know whats going bad.

 

My catalog/images folder is on the roor with CHMOD 755.

Link to comment
Share on other sites

  • 2 weeks later...

Hi everybody,

 

i have installed the 3.0 Version on a modded v2.2 RC2 - double checked the installation - i also have comment out if (empty($module)) {

$messageStack->add(ERROR_NEWSLETTER_MODULE, 'error');

$newsletter_error = true;

}

 

to avoid the 'Error: Newsletter module required'

 

everything seems right but when i go to the newsletter manager and choose newsletter_products i only get the 'newsletter'....

there is no products field or template field

is it possible that something with my sql changes went wrong?

 

i'm happy for any kind of help - happy easter - tomisa

Link to comment
Share on other sites

  • 3 weeks later...
I've got the same problem. How did you resolve this? I can't even find the code you quoted in your post.. In which file is it located?

Finally solved. I returned to the original code and it began to work.

 

/admin/includes/modules/newsletters/newsletter_products.php

		for ($i=0, $n=sizeof($this->productsInfo); $i<$n; $i++) {
		if ($col > COLS-1) {
			$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'], 120, 92) . '<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'], 120, 92) . '<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++;
	}

 

1.You must modify configure.php

2.Replace SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT with the numbers of your needs. If you dont change it by numbers there will no any images.

3.Dont use 0 as number. If you use 100,0 or 0,100 as image width and height , the images will be send as the original size(and correct proportions). I don´t know how to resolve this.

 

Do anybody knows how to send and email to a particular customer and not to all customers that receives newsletters???

use phpmyadmin to change the customer_newsletter field to 2 for every customer that has a customer_newsletter = 1.

UPDATE customers SET customers_newsletter = '2' where customers_newsletter = '1'

Make an account for yourself in your shop admin and set it to receive the newsletter - test away.

After your testing is complete, you can change your customer newsletter subscriptions back by using the following query.

UPDATE customers SET customers_newsletter = '1' where customers_newsletter = '2'

Is there any button in admin panel to change that, before sending a newsletter(without enter phpmyadmin)???

Edited by bhbilbao
Link to comment
Share on other sites

  • 3 months later...

Hi,

 

I have just installed Newsletter_products V3.0 2009.07.02.

 

When I try to preview a newsletter I created in admin I receive the following error:

 

Fatal Error: Call to undefined function: tep_image_newsletter() in .......admin/includes/modules/newsletters/newsletter_products.php on line 157

 

The function does exist in admin/includes/functions/html_output.php

 

How does OsCommerce/PHP know where to look for functions?

 

Please help.

Link to comment
Share on other sites

Hi,

 

I have just installed Newsletter_products V3.0 2009.07.02.

 

When I try to preview a newsletter I created in admin I receive the following error:

 

Fatal Error: Call to undefined function: tep_image_newsletter() in .......admin/includes/modules/newsletters/newsletter_products.php on line 157

 

The function does exist in admin/includes/functions/html_output.php

 

How does OsCommerce/PHP know where to look for functions?

 

Please help.

OK. Thanks for all your help, the problem is solved.

Link to comment
Share on other sites

  • 6 months later...

i'm trying to compine bulk mail contibution with newsletter products but unfortunately i cannot.

 

i think that the solution is to store all the newsletter including products and template in mysql.

 

is this can be done easily?

 

if so what is the code????

Link to comment
Share on other sites

  • 7 months later...

I have a new issue when sending emails.

The "reply to" recipient is wrong. To my customers showed like spam from extrange or new recipient.

It displays:

from Administrator [ myweb @ s15400000.onlinehome-server.info ]

 

and should be:

from Administrator [ info @ myweb.com ]

 

The web is allocated in a 1&1 domain server.

 

 

anybody??

 


$messageId = "Message-Id: <" . time() . "@" . $_SERVER['SERVER_NAME'] . ">";

// define('SERVERNAME', 'myweb.com');	
// $messageId = "Message-Id: <" . time() . "@" . SERVER_NAME . ">";
// $messageId = "Message-Id: <" . time() . "@myweb.com>";
// $messageId = ' . STORE_OWNER_EMAIL_ADDRESS . ';	




 $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer', $messageId));
 //  $mimemessage = new email(array('X-Mailer: osCommerce'));

  //   $mimemessage->add_text($this->content);
  //  $text = $this->text_content();

  $mimemessage->add_html($this->html_content(), $this->text_content(), HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES);

  $mimemessage->build_message();

  while ($mail = tep_db_fetch_array($mail_query)) {
  //STORE_OWNER	
  //STORE_OWNER_EMAIL_ADDRESS	
  //$mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title);
   $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, $this->title);

Dont bother if it could change to no-reply @ myweb.com

Edited by bhbilbao
Link to comment
Share on other sites

  • 9 months later...

Hello,

 

Does anyone know:

1. if this contribution is compatible for oscommerce 2.3?

2. if so, should I install a previous version and then make update to 3.0, or is there a full intsallation version of the 3.0?

 

Thank you.

Link to comment
Share on other sites

  • 1 year later...

Hello,

 

Anyone has a solution for this problem?

 

 

I have a new issue when sending emails.

The "reply to" recipient is wrong. To my customers showed like spam from extrange or new recipient.

It displays:

from Administrator [ myweb @ s15400000.onlinehome-server.info ]

 

and should be:

from Administrator [ info @ myweb.com ]

 

The web is allocated in a 1&1 domain server.

 

 

anybody??

 


$messageId = "Message-Id: <" . time() . "@" . $_SERVER['SERVER_NAME'] . ">";

// define('SERVERNAME', 'myweb.com');	
// $messageId = "Message-Id: <" . time() . "@" . SERVER_NAME . ">";
// $messageId = "Message-Id: <" . time() . "@myweb.com>";
// $messageId = ' . STORE_OWNER_EMAIL_ADDRESS . ';	




 $mimemessage = new email(array('X-Mailer: osCommerce bulk mailer', $messageId));
 // $mimemessage = new email(array('X-Mailer: osCommerce'));

// $mimemessage->add_text($this->content);
// $text = $this->text_content();

 $mimemessage->add_html($this->html_content(), $this->text_content(), HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES);

 $mimemessage->build_message();

 while ($mail = tep_db_fetch_array($mail_query)) {
 //STORE_OWNER	
 //STORE_OWNER_EMAIL_ADDRESS	
 //$mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], '', EMAIL_FROM, $this->title);
 $mimemessage->send($mail['customers_firstname'] . ' ' . $mail['customers_lastname'], $mail['customers_email_address'], STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, $this->title);

Dont bother if it could change to no-reply @ myweb.com

Link to comment
Share on other sites

  • 1 year later...

Using 2.3.4 getting this error to do with the $p_string:

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 order by products_name' at line 1

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 (select * from (select products_id, specials_new_products_price, expires_date, status from specials where status = 1 order by products_id, specials_new_products_price, expires_date) as t group by products_id) as s on pd.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in() and pd.language_id=1 order by products_name

[TEP STOP]

Is there a solution? The email won't send ...

 

Thanks,

 

Lorraine

Link to comment
Share on other sites

Here's the bit that creates it:

function productInfo(){
    	global $languages_id;
    	$this->productInfo = array();
    	$p_string = '';
		for($i=0, $n=sizeof($this->products); $i<$n; $i++){
			$p_string .= $this->products[$i] . ', ';
		}
		$p_string = trim($p_string, ', ');
		
    	$product_query = tep_db_query("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 " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd left join (select * from (select products_id, specials_new_products_price, expires_date, status from " . TABLE_SPECIALS . " where status = 1 order by products_id, specials_new_products_price, expires_date) as t group by products_id) as s on pd.products_id = s.products_id where pd.products_id = p.products_id and p.products_id in(" . $p_string . ") and pd.language_id=" . (int)$languages_id . " order by products_name");

Is there an error here? 

Link to comment
Share on other sites

  • 2 years later...

Hi There all, I have installed the module, and I am able to send a newletter and preview it in my admin. The emails arrive well.
However newsletter that are viewed online through "view_newsletter.php" show up empty and no information is showed, just the heading "View Newsletter".
It does provide the correct newsletter number.

It looks like the page is abruptly broken off because the other columns are not displayed either.

My gues is that it has something to do with the:echo $module->html_content(); but I am not sure.

---------

 

<?php

  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License

  require('includes/application_top.php');

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_VIEWNEWS);

  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_VIEWNEWS));

  require(DIR_WS_INCLUDES . 'template_top.php');
  
  require('includes/application_top.php');
?>

<h1><?php echo HEADING_TITLE; ?></h1>

<div class="contentContainer">
  <div class="contentText">
 
<?    
 $nID = (isset($HTTP_GET_VARS['nID']) ? tep_db_prepare_input($HTTP_GET_VARS['nID']) : 0);
  //newsletter products
    $newsletter_query = tep_db_query("select title, content, module, template from " . TABLE_NEWSLETTERS . " where newsletters_id = '" . (int)$nID . "'");
    if (tep_db_num_rows($newsletter_query) == 1) {
    $newsletter = tep_db_fetch_array($newsletter_query);
    $newsletter_products_query = tep_db_query("select products_id from " . TABLE_NEWSLETTERS_TO_PRODUCTS . " where newsletters_id = '" . (int)$nID . "'");
    while ($newsletter_products = tep_db_fetch_array($newsletter_products_query)) {
        $news_products[] = $newsletter_products['products_id'];
    }      
      $newsletter['products'] = $news_products;
      if ($newsletter['module'] == 'newsletter_products') {
          include('catalog/admin/includes/modules/newsletters/newsletter_products.php');
      include('catalog/admin/includes/languages/english/modules/newsletters/newsletter_products.php');
      $module = new newsletter_products($newsletter['title'], $newsletter['content'], $newsletter['products'], $newsletter['template']);
}}*/

   echo $module->html_content();
    } else {
      echo nl2br($newsletter['content']);
     }    
      //end newsletter products
   } else {
        echo TEXT_NOT_FOUND;
  }
    echo "\n";
        ?>
  </div>
  <div class="buttonSet">
    <span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_CONTINUE, 'triangle-1-e', tep_href_link(FILENAME_DEFAULT)); ?></span>
  </div>
</div>

<?php
  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Edited by current
Link to comment
Share on other sites

  • 2 years later...

i try to install your plugin in new OSCOM CE Phoenix

in

catalog/includes/modules/boxes/bm_information.php

FIND around line 41:
              '    <a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . MODULE_BOXES_INFORMATION_BOX_CONDITIONS . '</a><br />' .

ADD after it:
              '    <a href="' . tep_href_link(FILENAME_NEWSLIST) . '">' . MODULE_BOXES_INFORMATION_BOX_NEWS . '</a><br />' .

i havn't nothing of similar .

 

in attach my file

this line is in:

catalog/includes/templates/boxes

 

 

Enrico

bm_information.php

Edited by bitit.it
Link to comment
Share on other sites

on file catalog/admin/newsletters.php

require(DIR_WS_CLASSES . 'currencies.php');

don't working

require( 'currencies.php');

working but give this error

Fatal error: Cannot redeclare do_magic_quotes_gpc() (previously declared in /archivio/html/osnew/admin/includes/functions/compatibility.php:18) in /archivio/html/osnew/admin/includes/functions/compatibility.php on line 29

if i change  this:

//newsletter products
     //currenices class required for price display in newsletter
    require( 'currencies.php');
    $currencies = new currencies();
    //end newsletter products

whit this

//newsletter products
     //currenices class required for price display in newsletter
    //require( 'currencies.php');
    //$currencies = new currencies();
    //end newsletter products

i haven't error

Enrico

 

Link to comment
Share on other sites

also this give me error

    //newsletter products
       include(DIR_WS_MODULES . 'newsletters/newsletter_products.php');
       include(DIR_WS_LANGUAGES . $language . '/modules/newsletters/newsletter_products.php');
       $products = new newsletter_products('','', '', '');

    $parameters = array('title' => '',
                        'content' => '',
                        'module' => '',
                        'template' => '');
      //end newsletter products

this  don't give error

//newsletter products
       include("includes/modules/". 'newsletters/newsletter_products.php');
       include("includes/languages/". $language . '/modules/newsletters/newsletter_products.php');
       $products = new newsletter_products('','', '', '');

    $parameters = array('title' => '',
                        'content' => '',
                        'module' => '',
                        'template' => '');
      //end newsletter products

 

But nothing is change in the interface, i don't understand if don't working or how use this module

 

 

 

 

Screenshot_20190809_191519.png

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