Giter VIP home page Giter VIP logo

tjml-framework's Introduction

TJML email framework

It is an email framework that enables quick and convenient creation of cross-platform AMP and HTML emails with the help of TJML — an xml-like markup language.

Email Coding Optimization with TJML

  • automated HTML and AMP email creation from TJML code,
  • 50% faster HTML coding, as compared to regular email HTML coding,
  • looser skill requirements for frontend developers and HTML coders,
  • emails that respond correctly and immediately to screen size change, including the cases when media queries are not used,
  • emails that are displayed properly in Microsoft Outlook (2003-2020), as well as in outdated email clients, such as Lotus mail.

Additional Tools Available in the TJML framework Interface

  • dark mode check,
  • code compression,
  • responsive design preview,
  • pixelPerfect tool,
  • rendered HTML file size calculation,
  • single-click screenshot of the designed email.

TJML

TJML was build using Vue framework; each tag in it is a Vue component. To create an email, you need to add our JavaScript to your HTML file. Before sending, you should export the rendered HTML or AMP version of the email you created. As you export, each component will be transformed into regular email HTML.

Autocomplete

IDE Description
JetBrains IDEs (WebStorm, PhpStorm) You can use web-types for autocomplete TJML tags and attributes. Or use start pack for fast dive.
Visual Studio Code Install plugin from Marketplace or github

Enabling Ampier Framework

Insert the following JavaScript code immediately after the <body> tag:

<script type="text/javascript">
var s=document.createElement("script"),l=document.createElement("link"),d=new Date;s.setAttribute("src","https://ampier.io/tjml/app.js?ver="+d.getTime()),l.setAttribute("type","text/css"),l.setAttribute("rel","stylesheet"),l.setAttribute("href","https://ampier.io/tjml/app.css?ver="+d.getTime()),document.head.appendChild(l),document.body.appendChild(s); 
</script>

Email Structure

You need to stick to the following structure of the document: You can insert any TJML or email HTML code between the <m-body> and </m-body> tags. Please note that regular email HTML code will not allow for the creation of an AMP version of the email.

<tjml>
    <m-body>
        <!-- some TJML code -->
    </m-body>
</tjml>

Tags and Attributes

You can find detailed information about all the available tags (components) and attributes in the Ampier docs and wiki.

tjml-framework's People

Contributors

pixcraft-io avatar

Stargazers

Sanjib Kumar Sah avatar Dmitry Tomin avatar  avatar Sergey Artemov avatar Bellegar avatar  avatar Alexander Dedunovich avatar NULL avatar Aleksandr Ryabikov avatar Bryan Onwas avatar Nikita avatar Periklis Papanikolaou avatar  avatar  avatar Anton Chirkov avatar  avatar

Watchers

Alex Zalevski avatar Anton Chirkov avatar  avatar

tjml-framework's Issues

Combine with components from amp.dev

How can I add components from amp.dev for email? When I add script with import, for example <script async custom-element=‘amp-timeago’ src=‘https://cdn.ampproject.org/v0/amp-timeago-0.1.js’></script> it is not applied. As workaround I could add it after download like amp, but I'd like to see it in playground

Line-Height of button unexist in imaged m-wrap

If m-wrap contains background-image, produced m-button HTML code excludes line-height style attribute, so botton is not fully clickable.
It is perfectly seen on default template on https://ampier.io/playground/view/12556
Button over backgrounded m-wrap is not fully clickable, top and bottom of button is not clickable.

image

If i manually set css style with line-height, button becames whole clickable.

That bug is producing in web playground's internal HTML generator.

Outlook 2010 boxes width issue

This code

    <m-wrap padding="5px">
	<m-boxes valign="middle">
	    <m-box width="150">
	     <m-wrap padding="5">
	         <m-img src="cid:google-play-badge.png" href="***" alt="" height="41">
	         </m-img>
	     </m-wrap>
	    </m-box>
	    <m-box width="150">
	     <m-wrap padding="5">
	         <m-img src="cid:download-as-rustore.png" href="***" alt="" height="41">
	         </m-img>
	     </m-wrap>
	    </m-box>
	    <m-box width="150">
	     <m-wrap padding="5">
	         <m-img src="cid:download-as-apk.png" href="***" alt="" height="41">
	         </m-img>
	     </m-wrap>
	    </m-box>
	</m-boxes>
    </m-wrap>

Produces

<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr><td align="center" style="padding: 5px;">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td align="center" valign="middle" style="font-size: 0px;">
	<div style="display: inline-block; vertical-align: middle; width: 150px;">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse;">
		<tr><td align="center" valign="top" class="outf14" style="font-size: large;">
			<div>
				<table border="0" cellspacing="0" cellpadding="0" width="100%">
				<tr><td align="center" style="padding: 5px;">
					<a href="***" target="_blank" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; color: #000000;"><img src="cid:google-play-badge.png" height="41" alt="" border="0" style="display: block;"></a>
				</td></tr>
				</table>
			</div>
		</td></tr>
		</table>
	</div>
	<!--[if (gte mso 9)|(IE)]>
	</td>
	<td valign="middle" width="150" style="width: 150px">
	<![endif]-->
	<div style="display: inline-block; vertical-align: middle; width: 150px;">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse;">
		<tr><td align="center" valign="top" class="outf14" style="font-size: large;">
			<div>
				<table border="0" cellspacing="0" cellpadding="0" width="100%">
				<tr><td align="center" style="padding: 5px;">
					<a href="***" target="_blank" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; color: #000000;"><img src="cid:download-as-rustore.png" height="41" alt="" border="0" style="display: block;"></a>
				</td></tr>
				</table>
			</div>
		</td></tr>
		</table>
	</div>
	<!--[if (gte mso 9)|(IE)]>
	</td>
	<td valign="middle" width="150" style="width: 150px">
	<![endif]-->
	<div style="display: inline-block; vertical-align: middle; width: 150px;">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse;">
		<tr><td align="center" valign="top" class="outf14" style="font-size: large;">
			<div>
				<table border="0" cellspacing="0" cellpadding="0" width="100%">
				<tr><td align="center" style="padding: 5px;">
					<a href="***" target="_blank" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 14px; color: #000000;"><img src="cid:download-as-apk.png" height="41" alt="" border="0" style="display: block;"></a>
				</td></tr>
				</table>
			</div>
		</td></tr>
		</table>
	</div>
</td></tr>
</table>
</td></tr>
</table>

On Outlook 2010 it looks like this:
image

For (gte mso 9)|(IE) there is 3 <td> blocks, where 2nd and 3rd <td> have width="150" attribute, but first <td>, which is not wrapped in [id mso] comment, do not contain width attribute.
If i manually add width="150" to first <td>,
<tr><td align="center" width="150" valign="middle" style="font-size: 0px;">
it started to look more expected
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.