HTML Element functions

The HTML Email Template Editor represents HTML elements by HTML functions. These functions are contained in a HTML module added to your project when you return from the Email Template Editor. This page presents this basically simple approach and elaborates on some extended cases.

Tag becomes Function

Writing HTML for your email body results in code lines cluttered with HTML start and end tags. The obvious solution is to encapsulate theses in a function with the name of the tag. Calling the function returns the HTML string the actual HTML the function represents. Instead of

"<p>Hello " & strName & ",</p>"

you use

p("Hello " & strName & ",")

Calling the function p(...) returns the HTML <p>...</p>

Attributes as second parameter

Attributes take second place after content in the HTML functions, e.g.

p("Hello " & strName & ",", "id=pattr,title=example")

Attributes as third or fourth parameter

In three cases the function has received additional parameters: <a>, <abbr> and <img>. This concerns attributes that will normally always be used. Using these extra parameters give the function calls a natural feel, e.g.

a("HTML elements",href:="https://www.w3schools.com/tags/tag_a.asp")

returns

<a href="https://www.w3schools.com/tags/tag_a.asp">HTML elements</a>

Inspecting the HTML module

The first function you encounter is a already discussed above.

The second function you encounter is abbr which has the extra parameter title.

Elements commented out - not supported in email clients.

After the third, and actually all over the rest of the module you will find elements commented out. These are valid html elements, however they are generally not supported in email clients. So we commented them to indicate this. If you decide you still want to use the element, you can simply uncomment it.