Results 1 to 8 of 8
  1. #1
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    Default Help needed for email templates please!

    Hi everyone,

    I'm sorry if this sounds naive but I'm having trouble with properly formatting the various text and HTML emails sent to customers. Although I have managed to do the HTML order confirmation layout to my entire satisfaction, the text version is still a bit crude.

    Today, I tried to format the HTML email sent when the order status is updated. Although the layout is now fine, I found an additional issue which I'll try to explain below.

    I edited the file public_html/email/email_template_order_status.html and its contents are now slightly amended for a better-looking layout as follows:

    HTML Code:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=$CHARSET" />
    <base href="$BASE_HREF" />
    
    <style type="text/css">
    body {background-color:#ffffff; color:#000000; font-family:Verdana, Arial, Helvetica, sans-serif;}
    a:link {color:#0066cc;}
    a:hover {background-color:#eeeecc; color:#0066cc;}
    a:visited {color:#0066cc;}
    .holder {background-color:#f9f9f9; border:1px solid #9a9a9a; border-bottom:0; font-size:9px; text-align:left; width:550px;}
    .header {font-size:10px; padding:0px; width:550px;}
    .content {font-size:10px; padding:5px; width:550px;}
    .footer {font-size:9px; margin-top:5px; text-align:center; width:550px;}
    .disclaimer {background-color:#f9f9f9; border-top:1px solid #9a9a9a; border-bottom:1px solid #9a9a9a; font-size:9px; padding:5px; width:550px;}
    .disclaimer1 {color:#666666; padding:5px;}
    .disclaimer1 a:link {color:#666666;}
    .disclaimer1 a:visited {color:#666666;}
    .disclaimer2 {color:#666666; padding:5px;}
    .copyright {color:#666666;border:0px solid #9a9a9a;}
    .copyright a:link {color:#666666;}
    .copyright a:visited {color:#666666;}</style>
    
    </head>
    
    <body>
    <div class="holder">
    
      <!-- Header Section -->
      <div class="header">
      <img src="email/header.jpg" alt="Athens Collectibles" />
      </div>
    
    
      <!-- Content Section -->
      <div class="content">
        <div><b>Customer:</b> $EMAIL_CUSTOMERS_NAME<br> 
          <br /></div> 
        <div><b>$EMAIL_TEXT_ORDER_NUMBER<br>
          <br>
          </b></div>
        <div>$EMAIL_TEXT_INVOICE_URL<br>
          <br>
        </div>
        <div>$EMAIL_TEXT_DATE_ORDERED<br>
          <br>
        </div>
        <div>$EMAIL_TEXT_STATUS_COMMENTS
          <br>
        </div>
        <div>$EMAIL_TEXT_STATUS_UPDATED</div>
        <div>$EMAIL_TEXT_STATUS_LABEL<br>
          <br>
        </div>
        <div>$EMAIL_TEXT_STATUS_PLEASE_REPLY<br>
          <br>
        </div>
        <div>With our best regards<br>
          $EMAIL_STORE_NAME</div>
      </div>
    
    <div class="disclaimer">
      <div class="disclaimer1">
        $EMAIL_DISCLAIMER</div>
      <div class="disclaimer2">
        $EMAIL_SPAM_DISCLAIMER</div>
    </div>
    </div>
    
      <!-- Footer Section -->
      <div class="footer">
        <div class="copyright">$EMAIL_FOOTER_COPYRIGHT</div>
      </div>
    
    </body>
    </html>
    All is working fine but the copyright link at the bottom points to /admin/index.php (!) instead of to my home page.

    Another anomaly: I thought that the contents of text emails are pulled from the /includes/languages/english/my_template/email_extras.php but this doesn't seem to be the case. I have made some small amendments to this file which appear in the order confirmation text email but not in the order status text email which seems to read from the corresponding file in the /admin folder.

    Is there an explanation of what's going on or what I could be doing wrong? I think that the whole issue of formatting emails is quite complex -perhaps more than necessary- and the Wiki article is not very informative: it makes things even more complex by pointing to another file (includes/classes/order.php) as an example of formatting the order confirmation email. But, a) this is not an easy file for non programmers to edit and b) there don't seem to be similar files for other email templates.

    Any help or pointing me to the right direction will be much appreciated and will be useful in formatting more templates. Thank you in advance and kind regards.

    George

    Site: http://athenscollectibles.info
    Zen Cart version: 1.3.9h

  2. #2
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    Default Re: Help needed for email templates please!

    I restored the original public_html/email/email_template_order_status.html file from the installation files but the link still points to http://athenscollectibles.info/admin/index.php instead of to http://athenscollectibles.info/index.php

    Any ideas please?
    Attached Images Attached Images  

  3. #3
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    Default Re: Help needed for email templates please!

    More than a month since I posted and I wasn't honoured with a reply to this serious issue of the copyright notice at the bottom of emails sent by admin (like order update) linking to the admin rather than the store directory.

    I looked in the Bugs forum and found another thread on this problem recommending change of Email delivery options from PHP to smtpauth. I tried it but unfortunately there was no change.

    Another search in the same forum brought up the following thread: http://www.zen-cart.com/forum/showthread.php?t=168153 which gives the reason for this happening. Although it was disputed, the admin/includes/languages/english/email_extras.php file does make the copyright link pointing to the admin directory. The full contents of the 1.3.9h installation file below will prove it. It was reported as a bug of older foreign language packs but it is also the case with the english language pack of 1.3.9h.

    PHP Code:
    <?php
    /**
     * @package languageDefines
     * @copyright Copyright 2003-2007 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: email_extras.php 7161 2007-10-02 10:58:34Z drbyte $
     */

    // office use only
      
    define('OFFICE_FROM','<strong>From:</strong>');
      
    define('OFFICE_EMAIL','<strong>Email:</strong>');

      
    define('OFFICE_SENT_TO','<strong>Sent To:</strong>');
      
    define('OFFICE_EMAIL_TO','<strong>To Email:</strong>');

      
    define('OFFICE_USE','<strong>Office Use Only:</strong>');
      
    define('OFFICE_LOGIN_NAME','<strong>Login Name:</strong>');
      
    define('OFFICE_LOGIN_EMAIL','<strong>Login Email:</strong>');
      
    define('OFFICE_LOGIN_PHONE','<strong>Telephone:</strong>');
      
    define('OFFICE_LOGIN_FAX','<strong>Fax:</strong>');
      
    define('OFFICE_IP_ADDRESS','<strong>IP Address:</strong>');
      
    define('OFFICE_HOST_ADDRESS','<strong>Host Address:</strong>');
      
    define('OFFICE_DATE_TIME','<strong>Date and Time:</strong>');
      if (!
    defined('OFFICE_IP_TO_HOST_ADDRESS')) define('OFFICE_IP_TO_HOST_ADDRESS''OFF');

    // email disclaimer
      
    define('EMAIL_DISCLAIMER''This email address was given to us by you or by one of our customers. If you feel that you have received this email in error, please send an email to %s ');
      
    define('EMAIL_SPAM_DISCLAIMER','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.');
      
    define('EMAIL_FOOTER_COPYRIGHT','Copyright (c) ' date('Y') . ' <a href="' zen_href_link(FILENAME_DEFAULT) . '" target="_blank">' STORE_NAME '</a>. Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>');
      
    define('TEXT_UNSUBSCRIBE'"\n\nTo unsubscribe from future newsletter and promotional mailings, simply click on the following link: \n");

    // email advisory for all emails customer generate - tell-a-friend and GV send
      
    define('EMAIL_ADVISORY''-----' "\n" '<strong>IMPORTANT:</strong> For your protection and to prevent malicious use, all emails sent via this web site are logged and the contents recorded and available to the store owner. If you feel that you have received this email in error, please send an email to ' STORE_OWNER_EMAIL_ADDRESS "\n\n");

    // email advisory included warning for all emails customer generate - tell-a-friend and GV send
      
    define('EMAIL_ADVISORY_INCLUDED_WARNING''<strong>This message is included with all emails sent from this site:</strong>');


    // Admin additional email subjects
      
    define('SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_SUBJECT','[CREATE ACCOUNT]');
      
    define('SEND_EXTRA_TELL_A_FRIEND_EMAILS_TO_SUBJECT','[TELL A FRIEND]');
      
    define('SEND_EXTRA_GV_CUSTOMER_EMAILS_TO_SUBJECT','[GV CUSTOMER SENT]');
      
    define('SEND_EXTRA_NEW_ORDERS_EMAILS_TO_SUBJECT','[NEW ORDER]');
      
    define('SEND_EXTRA_CC_EMAILS_TO_SUBJECT','[EXTRA CC ORDER info] #');

    // Low Stock Emails
      
    define('EMAIL_TEXT_SUBJECT_LOWSTOCK','Warning: Low Stock');
      
    define('SEND_EXTRA_LOW_STOCK_EMAIL_TITLE','Low Stock Report: ');

    // for when gethost is off
      
    define('OFFICE_IP_TO_HOST_ADDRESS''Disabled');
    ?>
    It was interesting to notice that, as soon as I changed the zen_href_link(FILENAME_DEFAULT) to zen_catalog_href_link(FILENAME_DEFAULT) the link started pointing correctly to the store directory.

    If this is really a bug and one of the developers read this post, please have it corrected in the next release. And a note in the section of foreign language packs would warn people and save them some trouble and some security risks.

    I wish to thank the user Info2Share from Netherlands for finding the cause and providing the solution. Unfortunately his above thread is closed and I can not post there.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Help needed for email templates please!

    Quote Originally Posted by Athens Collectibles View Post
    Although it was disputed, the admin/includes/languages/english/email_extras.php file does make the copyright link pointing to the admin directory. The full contents of the 1.3.9h installation file below will prove it. It was reported as a bug of older foreign language packs but it is also the case with the english language pack of 1.3.9h.

    PHP Code:
    <?php
    /**
     * @package languageDefines
     * @copyright Copyright 2003-2007 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: email_extras.php 7161 2007-10-02 10:58:34Z drbyte $
     */

    // office use only
      
    define('OFFICE_FROM','<strong>From:</strong>');
      
    define('OFFICE_EMAIL','<strong>Email:</strong>');

      
    define('OFFICE_SENT_TO','<strong>Sent To:</strong>');
      
    define('OFFICE_EMAIL_TO','<strong>To Email:</strong>');

      
    define('OFFICE_USE','<strong>Office Use Only:</strong>');
      
    define('OFFICE_LOGIN_NAME','<strong>Login Name:</strong>');
      
    define('OFFICE_LOGIN_EMAIL','<strong>Login Email:</strong>');
      
    define('OFFICE_LOGIN_PHONE','<strong>Telephone:</strong>');
      
    define('OFFICE_LOGIN_FAX','<strong>Fax:</strong>');
      
    define('OFFICE_IP_ADDRESS','<strong>IP Address:</strong>');
      
    define('OFFICE_HOST_ADDRESS','<strong>Host Address:</strong>');
      
    define('OFFICE_DATE_TIME','<strong>Date and Time:</strong>');
      if (!
    defined('OFFICE_IP_TO_HOST_ADDRESS')) define('OFFICE_IP_TO_HOST_ADDRESS''OFF');

    // email disclaimer
      
    define('EMAIL_DISCLAIMER''This email address was given to us by you or by one of our customers. If you feel that you have received this email in error, please send an email to %s ');
      
    define('EMAIL_SPAM_DISCLAIMER','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.');
      
    define('EMAIL_FOOTER_COPYRIGHT','Copyright (c) ' date('Y') . ' <a href="' zen_href_link(FILENAME_DEFAULT) . '" target="_blank">' STORE_NAME '</a>. Powered by <a href="http://www.zen-cart.com" target="_blank">Zen Cart</a>');
      
    define('TEXT_UNSUBSCRIBE'"\n\nTo unsubscribe from future newsletter and promotional mailings, simply click on the following link: \n");

    // email advisory for all emails customer generate - tell-a-friend and GV send
      
    define('EMAIL_ADVISORY''-----' "\n" '<strong>IMPORTANT:</strong> For your protection and to prevent malicious use, all emails sent via this web site are logged and the contents recorded and available to the store owner. If you feel that you have received this email in error, please send an email to ' STORE_OWNER_EMAIL_ADDRESS "\n\n");

    // email advisory included warning for all emails customer generate - tell-a-friend and GV send
      
    define('EMAIL_ADVISORY_INCLUDED_WARNING''<strong>This message is included with all emails sent from this site:</strong>');


    // Admin additional email subjects
      
    define('SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_SUBJECT','[CREATE ACCOUNT]');
      
    define('SEND_EXTRA_TELL_A_FRIEND_EMAILS_TO_SUBJECT','[TELL A FRIEND]');
      
    define('SEND_EXTRA_GV_CUSTOMER_EMAILS_TO_SUBJECT','[GV CUSTOMER SENT]');
      
    define('SEND_EXTRA_NEW_ORDERS_EMAILS_TO_SUBJECT','[NEW ORDER]');
      
    define('SEND_EXTRA_CC_EMAILS_TO_SUBJECT','[EXTRA CC ORDER info] #');

    // Low Stock Emails
      
    define('EMAIL_TEXT_SUBJECT_LOWSTOCK','Warning: Low Stock');
      
    define('SEND_EXTRA_LOW_STOCK_EMAIL_TITLE','Low Stock Report: ');

    // for when gethost is off
      
    define('OFFICE_IP_TO_HOST_ADDRESS''Disabled');
    ?>
    It was interesting to notice that, as soon as I changed the zen_href_link(FILENAME_DEFAULT) to zen_catalog_href_link(FILENAME_DEFAULT) the link started pointing correctly to the store directory.

    If this is really a bug and one of the developers read this post, please have it corrected in the next release. And a note in the section of foreign language packs would warn people and save them some trouble and some security risks.
    Sorry, you're mistaken.

    The file you quoted is from the NON-Admin folder.

    The /admin/includes/languages/english/email_extras.php file DOES NOT contain any references to zen_href_link(), thus your real problem is that you're mixing up versions of the file.
    Quote Originally Posted by Athens Collectibles View Post
    More than a month since I posted and I wasn't honoured with a reply to this serious issue of the copyright notice at the bottom of emails sent by admin (like order update) linking to the admin rather than the store directory.
    The "security issue" you mention is one of your own creating, and not a result of using Zen Cart out-of-the-box. You've mixed up the files. Or your language translators have mixed up the files.
    .

    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.

  5. #5
    Join Date
    May 2010
    Location
    Athens, Greece
    Posts
    292
    Plugin Contributions
    0

    Default Re: Help needed for email templates please!

    Sorry, you're mistaken
    Sorry DrByte, I am indeed mistaken! I had mixed up the files some time ago trying to change the "Copyright Zen Cart" to "Copyright Athens Collectibles" in the email footer. Everything is fine now.

    My sincere apologies for the fuss.

  6. #6
    Join Date
    Apr 2012
    Location
    Iver, Bucks, UK
    Posts
    16
    Plugin Contributions
    0

    Default Re: Help needed for email templates please!

    http://www.tomopartstest.co.uk

    I have made significant progress for a newbie but one aspect has me stumped and that's the header graphic for emails. I have created a bespoke one and loaded it to where I believe it should go, no success. I have deleted all the instaces I can find of the default header'jpg file, still no success (expected at least to get emails with the big red cross) and I have no renamed our own header.jpg to tomoheader.jpg and changed all the referring code in the email folders to reflect that change, and still no success. Can someone please help me salvage the last few remaining strands of hair that I have...where should my tomoheader.jpg reside please...and and I don't appear to have email_extras...is that something I need to add?

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Help needed for email templates please!

    What happens if you replace the stock header.jpg with your own image, also named header.jpg? Where do you "believe it should go"?

    If you are missing a stock file, that would be an error to fix, not something new to add... and your e-mails would likely not be working correctly.
    Are you sure there is no file at /includes/languages/english/email_extras.php, or /admin/includes/languages/english/email_extras.php?

  8. #8
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Help needed for email templates please!

    The most common problem with changing the header.jpg is that your email-reader-client has cached the image. You need to press the Refresh button (often F5 or CTRL+R in Outlook), and/or empty your browser's cache (ie: Internet Explorer on Windows, since Outlook uses IE for displaying HTML emails) and restart your email client and browser.
    .

    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.

 

 

Similar Threads

  1. v155 Email templates for hire?
    By Kcin in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 1 Jul 2016, 12:36 AM
  2. Help needed for the "Tell-a-friend" HTML email template.
    By Athens Collectibles in forum Managing Customers and Orders
    Replies: 2
    Last Post: 4 Nov 2010, 10:08 PM
  3. Is email hosting needed for email in zencart to work?
    By shadowcast in forum Installing on a Linux/Unix Server
    Replies: 17
    Last Post: 8 Apr 2010, 04:39 PM
  4. Replies: 5
    Last Post: 17 Feb 2010, 05:13 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