News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Invoice templates with inline styles (without header css)

Started by Flash83, March 27, 2014, 23:37:51 PM

Previous topic - Next topic

Flash83

Hi all  :)
The problem is: Virtuemart invoice emails looks ugly in the most of web-mail systems (including gmail.com) because they have a css in the headers which are filtered by mail system. Thus styles are not applied and emails looks very poor in webmail, although they looks good in Outlook.

The view of mail in VirtueMart 2.0.x is defined by template: components\com_virtuemart\views\invoice\tmpl\mail_html.php

Styles are defined inside of head tags:

<head>
<style type="text/css">
    body, td, span, p, th {  }
    table.html-email {margin:10px auto;background:#fff;border:solid #dad8d8 1px;}
   .html-email tr{border-bottom : 1px solid #eee;}
    ...
    ...
</style>
</head>


How to make emails from Virtuemart in clean html, without css in headers? I don't think that re-write all default email templates with inline styles is good way, probably there is some easier solution or maybe existing templates optimized for webmail clients?

FelixR

You maybe right - but some email clients - Gmail included don't render html emails correctly with the css not inline
Pete Rossetti
Perfect Hosts
Chester UK

Currently using VM3.0.14 on Joomla 3.4.8

kash2011

I would like to make this topic relevant again because there is no answer given. I have this problem with a lot of my clients using GMAIL. the invoice email is unstyled and a mess without the style in the header.

Is there someone who knows a solution? or someone who knows how to get te style inline so I could do it myself?

Thank you:)

GJC Web Design

It is a straight forward html question

if Gmail requires inline css you have to add it in the appropriate template files

if it was table.html-email {margin:10px auto;background:#fff;border:solid #dad8d8 1px;}

you need to add the style directly

<table class="html-email " style="margin:10px auto;background:#fff;border:solid #dad8d8 1px;" >
<tr> etc

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

kash2011

Thanks! It is going to take a long time to convert all the style. But I guess this is the only solution.

Spiros Petrakis

Hi ,
it is true that the default order email is not compatible with most email clients. Html email templates are a very painful work that requires a lot of coding and even more testing because there are so many desktop and web email clients that have strange behaviors.

In my commercial template Hera i have added in the last version a very nice order email that has the following features

1) w3c valid XHTML code.
2) Correct coded to be compatible with most email clients including necessary hacks for several clients.
3) Tested with more than 30 web and desktop email clients.

this way you can be sure that the order emails can be read by your clients and also have a more professional look.

You can test it in my template demo   http://heravm3.virtuemarttemplates.eu
Joomla templates and extensions development
https://www.yourgeek.gr

barbara80


Spiros Petrakis

Joomla templates and extensions development
https://www.yourgeek.gr