Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2007
    Location
    sunny Florida, USA
    Posts
    81
    Plugin Contributions
    0

    Default '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

    Code:
    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
    Code:
    .disclaimer3 {color:#666666; padding:5px;}
    3) called the define created in email_extras.php within the email_template_welcome.html thus:
    Code:
    <div class="disclaimer3">$CPR_EMAIL_MULTI_SHIP_INFO</div>
    What I got in my sample email upon creation of a new account was this:

    Code:
    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 [email protected]  
       $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.

  2. #2
    Join Date
    Nov 2006
    Location
    Papworth, Cambridgeshire, UK
    Posts
    731
    Plugin Contributions
    3

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

  3. #3
    Join Date
    Mar 2007
    Location
    sunny Florida, USA
    Posts
    81
    Plugin Contributions
    0

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

    Quote Originally Posted by Chuckl View Post
    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.

  4. #4
    Join Date
    Nov 2006
    Location
    Papworth, Cambridgeshire, UK
    Posts
    731
    Plugin Contributions
    3

    Default 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

    Code:
    $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.

  5. #5
    Join Date
    Mar 2007
    Location
    sunny Florida, USA
    Posts
    81
    Plugin Contributions
    0

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

    That sure did the trick :)

    Thanks Chuckl!!

    Kind regards,
    ~Ray
    ++++++++++++++++
    Subtle as the 'b' in subtle.

 

 

Similar Threads

  1. v151 Preview welcome email and order confirmation email
    By tips007 in forum General Questions
    Replies: 1
    Last Post: 18 Jan 2013, 10:52 PM
  2. Order confirmation email - customization
    By tparvaiz in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 9 Jul 2011, 01:44 PM
  3. welcome email problem and order confirmation email problems
    By oneelios in forum General Questions
    Replies: 1
    Last Post: 22 Jan 2010, 11:18 AM
  4. welcome and order conformation email Graphics missing
    By duquecigars in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 20 Jul 2008, 04:44 PM
  5. Order Confirmation Success Email
    By KaworuNagisa in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 14 Dec 2007, 08:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR