MartinSStewart / send-grid / Email.Html

Only html tags that are supported by major all email clients are listed here. If you need something not that's included (and potentially not universally supported) use node.

These sources were used to determine what should be included: https://www.campaignmonitor.com/css/color-background/background/ https://www.pinpointe.com/blog/email-campaign-html-and-css-support https://www.caniemail.com/

Open an issue on github if something is missing or incorrectly included.

Html tags

a : List Attribute -> List Html -> Html

b : List Attribute -> List Html -> Html

br : List Attribute -> List Html -> Html

div : List Attribute -> List Html -> Html

font : List Attribute -> List Html -> Html

h1 : List Attribute -> List Html -> Html

h2 : List Attribute -> List Html -> Html

h3 : List Attribute -> List Html -> Html

h4 : List Attribute -> List Html -> Html

h5 : List Attribute -> List Html -> Html

h6 : List Attribute -> List Html -> Html

hr : List Attribute -> List Html -> Html

img : List Attribute -> List Html -> Html

label : List Attribute -> List Html -> Html

li : List Attribute -> List Html -> Html

node : String -> List Attribute -> List Html -> Html

This allows you to create html tags not included in this module (at the risk of it not rendering correctly in some email clients).

ol : List Attribute -> List Html -> Html

p : List Attribute -> List Html -> Html

span : List Attribute -> List Html -> Html

strong : List Attribute -> List Html -> Html

table : List Attribute -> List Html -> Html

td : List Attribute -> List Html -> Html

text : String -> Internal.Html

th : List Attribute -> List Html -> Html

tr : List Attribute -> List Html -> Html

u : List Attribute -> List Html -> Html

ul : List Attribute -> List Html -> Html


type alias Attribute =
Internal.Attribute


type alias Html =
Internal.Html

Inline images

inlineGifImg : Bytes -> List Attribute -> List Html -> Html

If you want to embed a gif within the email body, use this function. The normal approach of using a base64 string as the image src doesn't always with emails.

Note that some email clients won't animate the gif.

inlineJpgImg : Bytes -> List Attribute -> List Html -> Html

If you want to embed a jpg image within the email body, use this function. The normal approach of using a base64 string as the image src doesn't always with emails.

inlinePngImg : Bytes -> List Attribute -> List Html -> Html

If you want to embed a png image within the email body, use this function. The normal approach of using a base64 string as the image src doesn't always work with emails.

Convert

toHtml : Html -> Html msg

Convert a Email.Html.Html into normal a Html. Useful if you want to preview your email content.