Forums / General Questions / Changing email text depending on Order Status -- esp tied to Reward Points addon

Changing email text depending on Order Status -- esp tied to Reward Points addon

Locked

Views: 1,387

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
12 Jun 2009, 4:44 PM
#1
snowy2007 avatar

snowy2007

Zen Follower

Join Date:
Mar 2008
Posts:
100
Plugin Contributions:
0

Changing email text depending on Order Status -- esp tied to Reward Points addon

Hi all, Can anyone point me in the right direction to do the following :

I have a the rewards point full suite installed and customers reward points change their status from Pending to Earned when the Order Status changes from Pending to Processing.

When the Order Status changes, the system sends an email out automatically to tell the customer that their order status has changed to Pending. I would like to tag a message on to that to tell them that their Reward Points have also changed to "Earned" and can be spent - but I only want it to be sent with the Order Status changed to "Processing" email.

Any ideas please?

13 Jun 2009, 12:10 PM
#2
snowy2007 avatar

snowy2007

Zen Follower

Join Date:
Mar 2008
Posts:
100
Plugin Contributions:
0

Re: Changing email text depending on Order Status -- esp tied to Reward Points addon

I'm guessing that the following pseudo-code inserted into the module that creates the email when the order status changes is what is required :

if (order_status_variable == PROCESSING) {

insert text "You can now spend your pending reward points"
}

My question is, where is the module that creates the email and what is the variable name that indicates the order status (I am assuming it holds an integer value).

Any ideas please please please? :smile:

13 Jun 2009, 2:31 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Changing email text depending on Order Status -- esp tied to Reward Points addon

/admin/orders.php

You can find the correct number for the "Processing" order status by looking in the list of order statuses in Admin->Localization->Order Status.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

13 Jun 2009, 5:01 PM
#4
snowy2007 avatar

snowy2007

Zen Follower

Join Date:
Mar 2008
Posts:
100
Plugin Contributions:
0

Re: Changing email text depending on Order Status -- esp tied to Reward Points addon

DrByte:

/admin/orders.php

You can find the correct number for the "Processing" order status by looking in the list of order statuses in Admin->Localization->Order Status.

Thanks for that DrByte - Much appreciated - I have changed the code in Orders.php as follows but i'm sure there must be a more elegant way of doing it. It works though :) - The only thing that worries me is the use of the HTML <BR> ??

The code I have modified is in bold. Round about line 122ish

      $html_msg['EMAIL_TEXT_STATUS_LABEL'] = str_replace('\n','', sprintf(EMAIL_TEXT_STATUS_LABEL, $orders_status_array[$status] ));
      $html_msg['EMAIL_TEXT_NEW_STATUS'] = $orders_status_array[$status];
	  
	  **if ($orders_status_array[$status] == 'Processing') {
	    $pointstext = '<br>Any Reward Points that were Pending have now changed to Earned can can be redeemed against your next order. <br><br>';
		} else {
		$pointstext = '';
		}

** $html_msg['EMAIL_TEXT_STATUS_PLEASE_REPLY'] = **$pointstext . **str_replace('\n','', EMAIL_TEXT_STATUS_PLEASE_REPLY);

      $customer_notified = '0';
13 Jun 2009, 9:30 PM
#5
snowy2007 avatar

snowy2007

Zen Follower

Join Date:
Mar 2008
Posts:
100
Plugin Contributions:
0

Re: Changing email text depending on Order Status -- esp tied to Reward Points addon

Erm... the phrase "can can be redeemed against your next order" should be replaced with "AND can be redeemed against your next order"...

I certainly wasn't suggesting anyone should burst into an impromptu dance routine.... :P