Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Support Thread for HTML Status Update Auto-emailer with product images and links


Recommended Posts

Posted (edited)

email.jpg

 

 I did install your contribution.  Attached is the email image! 



But have a feeling it is all to do with the file admin/orders.php.  Because I have Package Tracking Plus installed.  Below issection of that code:

[codebox]//Package Tracking Plus BEGIN
	  $customer_notified = '0';
	  if ($HTTP_POST_VARS['notify'] == 'on' & ($usps_track_num == '' & $usps_track_num2 == '' & $ups_track_num == '' & $ups_track_num2 == '' & $fedex_track_num == '' & $fedex_track_num2 == '' & $dhl_track_num == '' & $dhl_track_num2 == '' ) ) {
		$notify_comments = '';
		if ($HTTP_POST_VARS['notify_comments'] == 'on') {
		  $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n";
		  if ($comments == null)
			$notify_comments = '';
		}

		$email = 'Dear ' . $check_status['customers_name'] . ',' . "\n\n" . STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . (int)$oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . "<a HREF='" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . (int)$oID, 'SSL') . "'>" .  'order_id=' . (int)$oID . "</a>\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n" . EMAIL_SEPARATOR . "\n\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
include('epis_statusmailer.php');






/**			$email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);
include('epis_statusmailer.php');  **/


	//	tep_mail($check_status['customers_name'], $check_status['customers_email_address'], STORE_NAME . ' ' . EMAIL_TEXT_SUBJECT_1. (int)$oID . EMAIL_TEXT_SUBJECT_2 . $orders_status_array[$status], $email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
		$customer_notified = '1';

	  }else if ($HTTP_POST_VARS['notify'] == 'on' & ($usps_track_num == '' or $usps_track_num2 == '' or $ups_track_num == '' or $ups_track_num2 == '' or $fedex_track_num == '' or $fedex_track_num2 == '' or $dhl_track_num == '' or $dhl_track_num2 == '' ) ) {
		$notify_comments = '';
		if ($HTTP_POST_VARS['notify_comments'] == 'on') {
		  $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n";
		  if ($comments == null)
			$notify_comments = '';
		if ($usps_track_num == null) {
		  $usps_text = '';
		  $usps_track = '';[/codebox]

So am wondering if the two are conflicting against each other.  Any clues would be appreciated.

Thanks.

Edited by blr044
Posted

What is probably happening is that on your modified admin/orders.php file, the program is running into instructions to send email before the it gets to the line installed for this contribution:

 

include(FILENAME_EPIS_STATUSMAILER);

 

That doesn't make complete sense, because my reasoning above would result in two emails.

 

but try this:

 

Look for any line with 'tep_mail' in admin/orders.php. If you find them, try commenting them out with // and see what happens.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Posted

Okay, I'm looking a bit closer at this and yes, it does look like there is some conflicting code. Specifically between $email and $epis_email.

 

Note that both the epis_emailer and package tracking plus are 'building' emails to send. However, the two variables, $epis_email and $email could be woven together.

 

For example, as a start, if you took the two variables $products_image and $products_link from epis_statusmailer.php and inserted them into the definition of $email, then the image and link of that product would be included (somewhere!) in the email that Package Tracking Plus sends.

 

However, you would have to locate the file epis_statusmailer.php up (place the line 'include('epis_statusmailer.php');')

higher up the page on admin/orders.php than the Package Tracking Plus. Also comment out the line, with //,

tep_mail($check_status['customers_name'], $check_status['customers_email_address'], EMAIL_TEXT_SUBJECT, $epis_email, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

 

in epis_statusmailer.php to stop the Status mailer from attempting to send an email.

 

Note that here is an example (untested!) of inserting $products_image and $products_link into the Packaging Plus email:

 

$email = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n". $products_image. $products_link . EMAIL_TEXT_ORDER_NUMBER . ' ' . $oID . "\n" . EMAIL_TEXT_INVOICE_URL . ' ' . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . $oID, 'SSL') . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n\n" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]);

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Posted
What is probably happening is that on your modified admin/orders.php file, the program is running into instructions to send email before the it gets to the line installed for this contribution:

 

include(FILENAME_EPIS_STATUSMAILER);

 

That doesn't make complete sense, because my reasoning above would result in two emails.

 

but try this:

 

Look for any line with 'tep_mail' in admin/orders.php. If you find them, try commenting them out with // and see what happens.

 

It did not change a thing! email still the same. Tomorrow I will comment out Package Tracking Plus out and retry, just to see wht happens.

Posted

I have tried a few things and still some minor issues.

 

First i removed Package mod - same issue.

 

Secondly I overwrite admin/orders.php with fresh file. Tested before installing your piece of code. Works.

 

But after adding your code, one minor problem. After updating status with update button, I get a blank page. Then I have to refresh browser window to display page. But email in in box as per example. But then I remofed your code and retried updating status. Works fine.

 

So after several test, with your code, I have to refresh browser after updating orser status.

 

Any ideas why?

 

Thanks.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

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