Render: https://theodo.github.io/signature/
scripts/config.js
signatureTemplates/*.html
that must be minified afterwards to avoid issues in some mail clients (font-size: 0 does not work everywhere).- Check CSS support in mail clients
NB: it can be usefull to change the config to point to the unminified template for your tests, but be sure not to commit that.
- no css resizing because some mail client don't support it and your logo will be very big (yes, your image will be low quality and there is nothing you can do about it). It means that the height/width of the HTML img should be the same as the image itself.
- if possible, exclude all text from the image as it will look very bad due to the low resolution. Instead, add the text in the HTML template.
- svg and embeded images (base64) do not work everywhere (so do not use them)
- background images do not work everywhere
- you most likely want to use png images with a transparent background (on mac os, there is now a dark theme that can make your signature look bad if it has a white background)
- to avoid playing with margins, be sure to use images whithout margins
npm install html-minifier-cli -g
./minimizeSignatures.sh
npm install serve -g
serve .
- Minimize the signature after each change
- Change images location to
localhost:5000
if you change the images
BEWARE Modifying the signature's style is very tricky. Indeed, the various mail clients modify the signature's style... You need to check that the signature renders correcty when received on:
- Gmail
- Mac mail client
- Outlook 2013+
⚠️ most of your problems will come from old versions of Outlook which are still widely used
In the signature template, use the following classes and ids (this needs clean up)
- class
signatureName
- class
signatureJob
- class
signatureMail
- class
signatureFrTel
- id
signatureUkTel
- id
signatureMaTel
- id
frenchAddress
- id
ukAddress
- See how to handle several phones with id
signatureFrTelGroup
,signatureUkTelGroup
, andsignatureMaTelGroup
in the code - Same with addresses
I don't recommend doing a CSS logo, but I did it for BAM (after many struggles) and here's what I learned
- relative and absolute positioning don't work
- negative margins don't work
- empty divs are not rendered in all mail clients (thanks Outlook 2013) but when it does,
overflow: hidden
also does. See how to use a text backup in BAM's signature. ;)
You can compare the rendering of your CSS with the image of the logo this way: