Zen Cart Logo
Forums / Bug Reports / Possible Holdover in E-mail Problems

Possible Holdover in E-mail Problems

Views: 556

Results 1 to 2 of 2
02 Feb 2020, 00:26
#1
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,760
Plugin Contributions:
9

Possible Holdover in E-mail Problems

RE: https://www.zen-cart.com/showthread.php?220558-Email-Header-not-showing

The above thread mentions problems finding out the location to define the header image, alt text, and title. The OP was correctly sent to the cart or admin's includes/languages/english/email_extras.php.

Having both the files in place and correctly modified to reflect our header file, size, alt text, and title; you can imagine my shock when none of this was followed in a newsletter.

As per the OP, I started looking with the Developer's Tool Kit to find the define. None could be found which led me to the above post. Yes, I did have the files in the correct location. Yes, I did have the changes needed to match my store.

The problem is this in a standard download of the latest 156c:

email_extras.php uses the following variables:

  • EMAIL_LOGO_FILENAME
  • EMAIL_LOGO_WIDTH
  • EMAIL_LOGO_HEIGHT
  • EMAIL_LOGO_ALT_TITLE_TEXT

email_template_newsletter.html uses:

  • EMAIL_LOGO_FILE
  • EMAIL_LOGO_WIDTH
  • EMAIL_LOGO_HEIGHT
  • EMAIL_LOGO_ALT_TEXT

    Further examination reveals that ALL html files for emails use the same variables as the newsletter.

Are there any problems that would occur if the email_extras.php were changed to reflect the variables used in the emails? Seems the quickest solution.

02 Feb 2020, 12:11
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,065
Plugin Contributions:
56

Re: Possible Holdover in E-mail Problems

Noting that the 'names' of those variables in the admin/storefront language files are 'translated' into the email template's block-names within the zen_mail function:

    // Handle logo image
    if (empty($block['EMAIL_LOGO_FILE'])) {
        $domain = (IS_ADMIN_FLAG === true) ? HTTP_CATALOG_SERVER : HTTP_SERVER;
        $block['EMAIL_LOGO_FILE'] = $domain . DIR_WS_CATALOG . 'email/' . EMAIL_LOGO_FILENAME;
    }
    if (!isset ($block['EMAIL_LOGO_ALT_TEXT']) || $block['EMAIL_LOGO_ALT_TEXT'] == '') $block['EMAIL_LOGO_ALT_TEXT'] = EMAIL_LOGO_ALT_TITLE_TEXT;
    if (!isset ($block['EMAIL_LOGO_WIDTH']) || $block['EMAIL_LOGO_WIDTH'] == '') $block['EMAIL_LOGO_WIDTH'] = EMAIL_LOGO_WIDTH;
    if (!isset ($block['EMAIL_LOGO_HEIGHT']) || $block['EMAIL_LOGO_HEIGHT'] == '') $block['EMAIL_LOGO_HEIGHT'] = EMAIL_LOGO_HEIGHT;

That said, changing those constants' names in the language files would not be a good thing.