Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2007
    Location
    Phoenix, AZ
    Posts
    69
    Plugin Contributions
    0

    Default Quick Question re: EMAIL_STYLESHEET in functions_email.php

    Hello all,

    In the course of wanting to add some custom content to my newsletter template, I found the following line in functions_email.php:

    Code:
        //  if ($block['EMAIL_STYLESHEET']=='')       $block['EMAIL_STYLESHEET']       = str_replace(array("\r\n", "\n", "\r"), "",@file_get_contents(DIR_FS_EMAIL_TEMPLATES.'stylesheet.css'));
    The idea of a common stylesheet across all email templates is appealing because I invariably for get to change one of the template files when updating the style. So my question is: why is this commented out? Was it found not to work, or is it just not tested enough to make it into the 1.3.8a release?

    Thanks!

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

    Default Re: Quick Question re: EMAIL_STYLESHEET in functions_email.php

    The feature wasn't fully implemented in 1.3.x.
    However, in the upcoming 2.0 it's fully integrated and easy to share a common stylesheet between all email templates.
    .

    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
    Jun 2007
    Location
    Phoenix, AZ
    Posts
    69
    Plugin Contributions
    0

    Default Re: Quick Question re: EMAIL_STYLESHEET in functions_email.php

    Quote Originally Posted by DrByte View Post
    The feature wasn't fully implemented in 1.3.x.
    However, in the upcoming 2.0 it's fully integrated and easy to share a common stylesheet between all email templates.
    Fantastic! Thanks!

  4. #4
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,589
    Plugin Contributions
    30

    Default Re: Quick Question re: EMAIL_STYLESHEET in functions_email.php

    Using a common css file for all the emails can be done by simply
    a) uncommenting out that line
    b) creating a stylesheet.css file in /emails that contains all the selectors used by all the emails
    c) putting
    HTML Code:
    <style type="text/css">
    <!--
    $EMAIL_STYLESHEET
    -->
    </style>
    in the head element of the emails.

    I did that and was thinking how clever I was but after researching more into html emails and how to build them, I concluded that it was actually a waste of time due to the shockingly-bad css support of the most popular email clients at this moment in time.
    It seems nested tables and manually-coded inline css is the only option if you want Outlook, Hotmail and Yahoo Mail users to see a similarly formatted email.

    There is a tool for converting html and css styles into inline css, premailer.dialect.ca
    but Outlook 2007 still managed to mangle the formatting.
    Tables rool!

  5. #5
    Join Date
    Jun 2007
    Location
    Phoenix, AZ
    Posts
    69
    Plugin Contributions
    0

    Default Re: Quick Question re: EMAIL_STYLESHEET in functions_email.php

    I also had to go back to tables. After some tinkering I managed to get the stylesheet set up in such a way that (most) mail clients didn't mangle the formatting. However, the deal-breaker was that many providers -- including Yahoo! -- were classifying my messages as spam because of all the div's. Once I went back to tables and trimmed down the stylesheet, my messages started getting through again.

    So much for trying to do it "the right way."

 

 

Similar Threads

  1. v153 v153 includes/functions/functions_email.php BUG
    By dee_d_lady in forum Bug Reports
    Replies: 1
    Last Post: 3 Sep 2014, 08:05 PM
  2. Replies: 7
    Last Post: 11 Oct 2012, 07: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