Forums / General Questions / 'welcome' and 'order success' email customization

'welcome' and 'order success' email customization

Locked

Views: 2,370

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
11 Oct 2007, 8:34 PM
#1
bouncerfl avatar

bouncerfl

New Zenner

Join Date:
Mar 2007
Location:
sunny Florida, USA
Posts:
80
Plugin Contributions:
0

'welcome' and 'order success' email customization

HI all,

I've tried to add a custom 'define' and then call it from within an email template, but I get the actual text of the define var instead of the value assigned to it.

What I've done(after having backed up files being worked on, of course! <g>):

  1. added the following to /zenroot/includes/languages/english/email_extras.php
define('CPR_EMAIL_MULTI_SHIP_INFO', 'Shipping estimates provided at the time of your order represent the charges if all products on your order are shipped at the same time.  If your order consists of multiple items and not all are ready at the time your order is placed, CPR Tools will ship items which are ready, and hold the back ordered products for shipment
when they become ready.  Each shipment to you will incur a separate shipping and handling fee.\n\nIf you would prefer that we ship your order in its entirety (i.e. hold \'ready\' items until \'back ordered\' items become ready), you must notify us immediately by email to [email protected].     Please include your order number with all correspondence. \n\n');
```2) added a css class to /zenroot/email/email_template_welcome.html

.disclaimer3 {color:#666666; padding:5px;}

<div class="disclaimer3">$CPR_EMAIL_MULTI_SHIP_INFO</div> ```What I got in my sample email upon creation of a new account was this:
This email address was given to us by you or by one of our customers. If you did not signup for an account, or feel that you have received this email in error, please send an email to [URL="http://www.cprtools.net/store/"][email protected] [/URL] 
   $CPR_EMAIL_MULTI_SHIP_INFO
   This email is sent in accordance with the US CAN-SPAM Law in effect 01/01/2004. Removal requests can be sent to this address and will be honored and respected.
```I realize I've missed something here and am hoping for a pointer.  My ultimate goal is to add the same disclaimer to the welcome email and the checkout_success one as well.

TIA,
~Ray

++++++++++++++++
Subtle as the 'b' in subtle.

11 Oct 2007, 9:04 PM
#2
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: 'welcome' and 'order success' email customization

The actual emails for the welcome and order confirmation are generated in /includes/modules/create_account.php and /includes/classes/order.php.

12 Oct 2007, 11:43 AM
#3
bouncerfl avatar

bouncerfl

New Zenner

Join Date:
Mar 2007
Location:
sunny Florida, USA
Posts:
80
Plugin Contributions:
0

Re: 'welcome' and 'order success' email customization

Chuckl:

The actual emails for the welcome and order confirmation are generated in /includes/modules/create_account.php and /includes/classes/order.php.
Thanks Chuckl, but I'm still a bit confused.

I'd like to have my custom define applied, but I'm clearly not sure where to put that or how to adjust either the create_account.php page or the order.php page you mentioned.

Any help here would be greatly appreciated. To simplify the question, I want to define a constant and have it called in both the account creation email and the order confirm email.

TIA for any assistance,

~Ray

++++++++++++++++
Subtle as the 'b' in subtle.

12 Oct 2007, 12:07 PM
#4
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: 'welcome' and 'order success' email customization

Hardly surprising, you need the secret code of the ancients...

If you look at /modules/create_account.php in the section near the bottom where the email is being generated, there are a lot of lines like this

$html_msg['EMAIL_MESSAGE_HTML'] = str_replace('\n','',EMAIL_TEXT);

The important points being that $html_msg is an array of test string data that is passed to the email send routine zen_mail in functions_email.php, which in turn passes it to the zen_build_html_email_from_template routine.

If you examine the array key above, EMAIL_MESSAGE_HTML, and then look at email_template_welcome.html in the email templates folder, you will see the same key there, with a $ added to the front i.e. $EMAIL_MESSAGE_HTML.

All the build_html_email routine does is look for the matching key with a $ added, and replace it in that position in the template with whatever text it has defined for that key.

So in your case you have defined a $CPR_EMAIL_MULTI_SHIP_INFO, you need to add a

$html_msg['CPR_EMAIL_MULTI_SHIP_INFO'] = CPR_EMAIL_MULTI_SHIP_INFO;

somewhere in that email creation routine. Ditto in orders.php for the order conf.

12 Oct 2007, 7:19 PM
#5
bouncerfl avatar

bouncerfl

New Zenner

Join Date:
Mar 2007
Location:
sunny Florida, USA
Posts:
80
Plugin Contributions:
0

Re: 'welcome' and 'order success' email customization

That sure did the trick :)

Thanks Chuckl!!

Kind regards,
~Ray

++++++++++++++++
Subtle as the 'b' in subtle.