![]() ![]() We can then use that to set the body variable that our _emails/index.html file uses. Just as easy! Formie will do the same thing as Craft's system emails, by injecting a contentHtml variable to the template. templates/_forms/email-template/index.html Now that Craft is using our template, we'll ensure Formie does too. This is compatible with Craft's system emails, which inject a body variable to this template.Īs such, you can navigate to Settings → Email and use this template for the HTML Email Template setting (set to _emails). ![]() Short and sweet! We extend from the layout we've created and in the content block, include the body of content to show. Now onto the email template that we'll use for system emails. This should look incredibly familiar to your regular Twig templates! , which we can use in other templates that extend this layout. Introduction If you havent heard about it yet, theres already an email framework that makes it less painful to build responsive email templates. Ready to use and easy to adapt to your needs. This will be completely compatible with Craft's own system emails, and we'll show how we can make use of that with Formie. Find the best email templates for your project, hand-coded with MJML framework. We'll create two files, a layout and an index file. The presets section will provide a selection of the best community templates using MJML. You can also write regular HTML if you prefer, this guide will still work regardless. MJML is a modern email tool that allows developers to create great emails that are beautiful and responsive across all devices and mail clients. You'll also need to have MJML available on the command line, as a globally-installed NPM package. There's an MJML Craft Plugin (opens new window) available to install, so download and install that. We're going to use MJML (opens new window) to construct our email templates, as it makes creating responsive, cross-browser templates a breeze. ![]()
0 Comments
Leave a Reply. |