If this is your first visit, check our documentation. To post, register or login.
Forums / All Other Contributions/Addons / Common Email Styling [Support Thread]

Common Email Styling [Support Thread]

Started by lat9 on 18 Sep 2015, 7:18 PM · Views: 8,320

Results 1 to 20 of 42
18 Sep 2015, 7:18 PM
#1
lat9 avatar

lat9

Administrator

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

Common Email Styling [Support Thread]

This plugin modifies the way that HTML emails are processed by your store:

  1. Consolidated CSS file that applies to all email templates
  2. HTML email logo information specified once (well, twice since there's a store-side and an admin-side file). No more editing thirteen separate templates to get a new logo file included!
  3. Enabled for responsive email views

https://www.zen-cart.com/downloads.php?do=file&id=2028

18 Sep 2015, 7:42 PM
#3
lat9 avatar

lat9

Administrator

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

Re: Common Email Styling [Support Thread]

Happy campers are good! Here's the download link, which will be active once the plugin has been reviewed: https://www.zen-cart.com/downloads.php?do=file&id=2028

18 Sep 2015, 8:49 PM
#4
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,846
Plugin Contributions:
0

Re: Common Email Styling [Support Thread]

I think I am gonna stop working on my projects and just send you my wishlist

Mike
AEIIA - Zen Cart Certified & PCI Compliant Hosting
The Zen Cart Forum...Better than a monitor covered with post-it notes!

18 Sep 2015, 9:03 PM
#5
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,846
Plugin Contributions:
0

Re: Common Email Styling [Support Thread]

I downloaded it from your website and took a look, very nice.

Mike
AEIIA - Zen Cart Certified & PCI Compliant Hosting
The Zen Cart Forum...Better than a monitor covered with post-it notes!

18 Sep 2015, 10:05 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Common Email Styling [Support Thread]

Which email clients (and versions) has this been tested with ... both PC/device-based and browser-based?

The reason the CSS was put into each individual template was to deal with serious incompatibilities across clients.

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

18 Sep 2015, 10:07 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Common Email Styling [Support Thread]

lat9:

No more editing thirteen separate templates to get a new logo file included!
One never needed to edit any templates for the logo file. Just name the logo file to suit what's already in the templates.

Just sayin.

Granted, if you had a legitimate reason to change the file "extension" that would have posed a small complication.

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

18 Sep 2015, 10:27 PM
#8
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,846
Plugin Contributions:
0

Re: Common Email Styling [Support Thread]

Dr. Byte. I looked at the module already and the css gets inlined in the header when sent.

Mike
AEIIA - Zen Cart Certified & PCI Compliant Hosting
The Zen Cart Forum...Better than a monitor covered with post-it notes!

19 Sep 2015, 2:46 PM
#9
lat9 avatar

lat9

Administrator

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

Re: Common Email Styling [Support Thread]

DrByte:

Which email clients (and versions) has this been tested with ... both PC/device-based and browser-based?

The reason the CSS was put into each individual template was to deal with serious incompatibilities across clients.
Like barco57 indicated, the CSS-file's contents are "in-lined" in the emails' HTML. The primary difference here is that each email contains all the styling rules.

DrByte:

One never needed to edit any templates for the logo file. Just name the logo file to suit what's already in the templates.

Just sayin.

Granted, if you had a legitimate reason to change the file "extension" that would have posed a small complication.
Since I was mucking with the template-files anyway, I figured that this was a good time to also make the email header-image customizable as well to give store-owners a choice in the image file-type -- while recognizing, hopefully, that .png images might not be displayable on all email engines.

19 Sep 2015, 3:53 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Re: Common Email Styling [Support Thread]

lat9:

Like barco57 indicated, the CSS-file's contents are "in-lined" in the emails' HTML. The primary difference here is that each email contains all the styling rules.
Fair. I've been contemplating merging/inlining all the styles one day, so I'm glad to see it tackled.

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

19 Sep 2015, 6:35 PM
#11
lloyd_borrett avatar

lloyd_borrett

Zen Follower

Join Date:
Mar 2006
Location:
Rosebud, Victoria, Australia
Posts:
308
Plugin Contributions:
2

Re: Common Email Styling [Support Thread]

G'day,

This plugin comes out of customisation work lat9 has been doing for me on the online dive shop at https://www.scubadoctor.com.au/diveshop/

We've gone through and totally revised all of the site's email content plus made mods to do things like: include social media icons, and highlight 'non-standard' details of orders in the admin emails to help improve back-end workflow.

We're just about to finalise making access to a tax invoice that meets Australian Tax Office requirements available to customers via the Order Confirmation email. (It's already working from the Order Information page.)

Plus the emails now pass HTML validation, which helps with displaying them in some email readers.

Best regards, Lloyd Borrett.

Zen Cart 1.5.5e, PHP 5.3.29 MySQL 5.5.42

20 Sep 2015, 5:01 PM
#12
lat9 avatar

lat9

Administrator

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

Re: Common Email Styling [Support Thread]

v1.0.0 of the plugin is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2028

Please note that this plugin simply

  • moves all CSS styling to a (later in-lined) CSS file
  • moves the specification of the logo's file information to a common language file
  • adds an HTML id= tag to each template's <body> tag
  • adds a <meta> viewport tag to each template's <head> section
    Some of the other changes that Lloyd refers to, like the emails now passing HTML validation, are specific to his site's customizations.
21 Sep 2015, 8:08 AM
#13
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,022
Plugin Contributions:
2

Re: Common Email Styling [Support Thread]

My mouse blows bubbles on your site. Very cool. Glen Iris.

lloyd_borrett:

This plugin comes out of customisation work lat9 has been doing for me on the online dive shop at https://www.scubadoctor.com.au/diveshop/

28 Sep 2015, 1:18 AM
#14
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Common Email Styling [Support Thread]

lat9:

v1.0.0 of the plugin is now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2028

Please note that this plugin simply

  • moves all CSS styling to a (later in-lined) CSS file
  • moves the specification of the logo's file information to a common language file
  • adds an HTML id= tag to each template's <body> tag
  • adds a <meta> viewport tag to each template's <head> section

Some of the other changes that Lloyd refers to, like the emails now passing HTML validation, are specific to his site's customizations.

You rock!!!

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

29 Sep 2015, 5:13 AM
#15
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Common Email Styling [Support Thread]

Years ago, I took the time to update all 13 email templates so that they were all consistent in look/feel.. Today I took those same changes and applied them to ONE FILE, and got treated to INSTANT gratification applied to ALL 13 email templates.. (all without spilling a drop of my delicious wine :laugh:)

Thanks lat9 for an AWESOME module!!

One question.. One thing I could never quite figure out is how to add the store address and/or phone/fax from the store's configuration information just below the logo. Any hints on how to do this??

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

29 Sep 2015, 11:23 AM
#16
lat9 avatar

lat9

Administrator

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

Re: Common Email Styling [Support Thread]

Thanks, Diva. That was exactly the problem that was solved by this plugin. Lloyd (@lloyd_borrett) had tasked me with getting the same look-and-feel in all the emails sent by his shop and I could see myself applying each incremental change to 13 email templates (not my idea of a fun time). Pulling the CSS out to a separate file allowed me, like you, to make those incremental changes in one place!

One way to add extra header information (I'll note the change request in the plugin's GitHub repository) would be to update ***each ***of the templates adding the highlighted element to the email's logo area:

      <!-- Header Section -->
      <div class="header">
        <img src="$EMAIL_LOGO_FILE" alt="$EMAIL_LOGO_ALT_TEXT" title="$EMAIL_LOGO_ALT_TEXT" width="$EMAIL_LOGO_WIDTH" height="$EMAIL_LOGO_HEIGHT" border="0" />
        [B] $EXTRA_HEADER_INFO[/B]
      </div>

Then, update the files /YOUR_ADMIN/includes/languages/english/email_extras.php and /includes/languages/english/YOUR_TEMPLATE/email_extras.php, adding:

  define ('EMAIL_LOGO_FILENAME', 'header.jpg');  //-File is present in /email folder
  define ('EMAIL_LOGO_WIDTH', '550');
  define ('EMAIL_LOGO_HEIGHT', '110');
  define ('EMAIL_LOGO_ALT_TITLE_TEXT', 'Zen Cart! The Art of E-commerce');
  [B]define ('EMAIL_EXTRA_HEADER_INFO', '<div>Extra stuff for header</div>');[/B]

Finally, update the zen_mail function to pull that information in to **all **email templates:

    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;
    [B]if (!isset ($block['EXTRA_HEADER_INFO']) || $block['EXTRA_HEADER_INFO'] == '') $block['EXTRA_HEADER_INFO'] = EMAIL_EXTRA_HEADER_INFO;[/B]
29 Sep 2015, 11:37 AM
#17
badarac avatar

badarac

Totally Zenned

Join Date:
Aug 2009
Location:
Longs, SC
Posts:
635
Plugin Contributions:
0

Re: Common Email Styling [Support Thread]

Joy fills the world and happiness abounds! Thanks Lat, you rock!!!

30 Sep 2015, 1:28 AM
#18
countrycharm avatar

countrycharm

Totally Zenned

Join Date:
Jul 2007
Posts:
2,179
Plugin Contributions:
2

Re: Common Email Styling [Support Thread]

Will this work on zen cart v1.5.1?

Is your site Upgraded to the current version 1.5.4 Yet?
zencart-upgrades-website-installation

30 Sep 2015, 1:52 PM
#19
lat9 avatar

lat9

Administrator

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

Re: Common Email Styling [Support Thread]

countrycharm:

Will this work on zen cart v1.5.1?
Yes, but you'll need to merge the core-file changes to /includes/functions/functions_email.php (the plugin uses ZC 1.5.4 as its basis for any core-file modifications, and there were significant changes in functions_email.php between v1.5.1 and 1.5.4).

30 Sep 2015, 7:02 PM
#20
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Common Email Styling [Support Thread]

lat9:

Thanks, Diva. That was exactly the problem that was solved by this plugin. Lloyd (@lloyd_borrett) had tasked me with getting the same look-and-feel in all the emails sent by his shop and I could see myself applying each incremental change to 13 email templates (not my idea of a fun time). Pulling the CSS out to a separate file allowed me, like you, to make those incremental changes in one place!No it was NO fun.. which is why I saved the work I had done to reuse for other clients.. This was LOADS easier!!!

lat9:

One way to add extra header information (I'll note the change request in the plugin's GitHub repository) would be to update ***each ***of the templates adding the highlighted element to the email's logo area:

  <!-- Header Section -->
  <div class="header">
    <img src="$EMAIL_LOGO_FILE" alt="$EMAIL_LOGO_ALT_TEXT" title="$EMAIL_LOGO_ALT_TEXT" width="$EMAIL_LOGO_WIDTH" height="$EMAIL_LOGO_HEIGHT" border="0" />
    [B] $EXTRA_HEADER_INFO[/B]
  </div>
> Then, update the files /YOUR_ADMIN/includes/languages/english/email_extras.php and /includes/languages/english/YOUR_TEMPLATE/email_extras.php, adding:
> ```
  define ('EMAIL_LOGO_FILENAME', 'header.jpg');  //-File is present in /email folder
  define ('EMAIL_LOGO_WIDTH', '550');
  define ('EMAIL_LOGO_HEIGHT', '110');
  define ('EMAIL_LOGO_ALT_TITLE_TEXT', 'Zen Cart! The Art of E-commerce');
  [B]define ('EMAIL_EXTRA_HEADER_INFO', '<div>Extra stuff for header</div>');[/B]

Finally, update the zen_mail function to pull that information in to **all **email templates:

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;
[B]if (!isset ($block['EXTRA_HEADER_INFO']) || $block['EXTRA_HEADER_INFO'] == '') $block['EXTRA_HEADER_INFO'] = EMAIL_EXTRA_HEADER_INFO;[/B]
Outstanding.. Will apply these changes.. Thanks again!! You are the best!!!

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.