Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2014
    Location
    Ontario, Canada
    Posts
    252
    Plugin Contributions
    3

    bug Bug? - Email logo not loading in admin emails 1.55f

    I want to have the email header image displayed in every email that comes from zen.

    I'm using a stock cart 155f, php 7.1.

    Looking at includes/functions/functions_email.php
    PHP Code:
     if (!isset ($block['EMAIL_LOGO_FILE']) || $block['EMAIL_LOGO_FILE'] == '') {
          if (
    IS_ADMIN_FLAG === true) {
            
    $block['EMAIL_LOGO_FILE'] = HTTP_CATALOG_SERVER DIR_WS_CATALOG 'email/' EMAIL_LOGO_FILENAME;

          } else {
            
    $block['EMAIL_LOGO_FILE'] = HTTP_SERVER DIR_WS_CATALOG 'email/' EMAIL_LOGO_FILENAME
    if I change the code to this:
    PHP Code:
    if (!isset ($block['EMAIL_LOGO_FILE']) || $block['EMAIL_LOGO_FILE'] == '') {
          if (
    IS_ADMIN_FLAG === true) {
            
    $block['EMAIL_LOGO_FILE'] = HTTP_SERVER DIR_WS_CATALOG 'email/' EMAIL_LOGO_FILENAME;

          } else {
            
    $block['EMAIL_LOGO_FILE'] = HTTP_SERVER DIR_WS_CATALOG 'email/' EMAIL_LOGO_FILENAME


    ALL emails sent live or admin have an image displayed when before the code change there were images missing.

    I checked and HTTP_CATALOG_SERVER - and - HTTP_SERVER have exactly the same data in every instance found in the site correctly.

    That means there is a problem with $block['EMAIL_LOGO_FILE'] not being set?

    or there is a problem with IS_ADMIN_FLAG === true not being set?

    I'm not looking to do this... although this produced a testable result... that pointed at a problem with the actual code.https://www.zen-cart.com/showthread.php?75245-NO-IMAGES-or-html-in-emails

  2. #2
    Join Date
    Jan 2004
    Posts
    66,373
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Bug? - Email logo not loading in admin emails 1.55f

    In the actual email HTML, what's the URL to the image? (you'll have to look at the raw HTML content of the received email to find this)

    That will give you clues to the cause of the issue.

    Your posted code change strongly suggests that your HTTP_CATALOG_SERVER url isn't correct.

    Also, you didn't post "which" admin emails you're referring to.
    .

    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.

  3. #3
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: Bug? - Email logo not loading in admin emails 1.55f

    I can reproduce this problem in a bone stock 1.55f site...


    includes/configure.php
    define('HTTP_SERVER', 'http://twitchtoo.com');
    define('HTTPS_SERVER', 'https://twitchtoo.com');

    define('ENABLE_SSL', '');

    define('DIR_WS_CATALOG', '/vanillas/');
    define('DIR_WS_HTTPS_CATALOG', '/vanillas/');


    admin/includes/configure.php
    define('HTTP_SERVER', 'http://twitchtoo.com');

    define('HTTP_CATALOG_SERVER', 'http://twitchtoo.com');
    define('HTTPS_CATALOG_SERVER', 'https://twitchtoo.com');

    define('ENABLE_SSL_CATALOG', '');

    define('DIR_WS_CATALOG', '/vanillas/');
    define('DIR_WS_HTTPS_CATALOG', '/vanillas/');

    includes/functions/functions_email.php
    if (!isset ($block['EMAIL_LOGO_FILE']) || $block['EMAIL_LOGO_FILE'] == '') {
    if (IS_ADMIN_FLAG === true) {
    $block['EMAIL_LOGO_FILE'] = HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'email/' . EMAIL_LOGO_FILENAME;

    } else {
    $block['EMAIL_LOGO_FILE'] = HTTP_SERVER . DIR_WS_CATALOG . 'email/' . EMAIL_LOGO_FILENAME;

    }
    }


    Here's the catch. When the administrator's email address is processed through this code it gets filtered - if the administrator is also a customer. Meaning that it will 'see' and use the HTML/Text-Only switch position recorded for that account.

    Having placed 'test' orders with my admin email address this condition exists, and remains unless you change the TEXT-Only switch to HTML (in Admin >Customers > select customer/edit). Doing so will add the image and rich text to the admin emails sent.

    If I delete my account from the customers list I get Text-Only emails with no image from admin to the admin email address regardless of the switch position in Admin >Configuration >Email Options >Email Admin Format - Set for HTML


    Other settings to consider:
    Admin >Configuration >Email Options >Enable HTML Emails - Set to True

    Admin >Configuration >Customer Details >Customer Default Email Preference - Set to 1 - HTML

    Also, I have tried this using a working and forced path directly to the header.jpg in the /email folder. Tested to prove it is working and displaying correctly regardless of switches. That proved it was not related to the path 'being wrong' instead, careful analysis of the email source code shows the image code doesn't even exist. This implies the code was scrubbed or ran through a true/false switch without a plan b if the switch failed.
    Twitch.
    https://www.twitchtoo.com Do you work for free? Please donate.
    Twitch Base8 - Obsidian - This, is what's new.

 

 

Similar Threads

  1. v150 Why is my LOGO.jpeg file not loading in the Banner
    By darknight in forum General Questions
    Replies: 5
    Last Post: 16 Jan 2013, 01:33 PM
  2. Replies: 4
    Last Post: 24 Jun 2010, 07:00 PM
  3. Replies: 1
    Last Post: 11 Jul 2009, 02:10 AM
  4. Logo banner not loading right
    By cellz4less in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 11 Jun 2009, 11:27 PM
  5. tools > send email > loading loading loading
    By keylesslocks in forum General Questions
    Replies: 6
    Last Post: 29 Aug 2008, 12:10 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