![]() ![]() 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). Ive got an MJML template which compiles to HTML, and am wanting to load variables from a JSON file to the template. If you see any error in a template or a way to enhance a template, feel free to submit a pull-request with your changes. Fixing a template Some of those templates could do with a good clean and we truly appreciate help. Short and sweet! We extend from the layout we've created and in the content block, include the body of content to show. email-templates A collection of responsive email templates coded in MJML and available on mjml.io/templates. 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. This will be completely compatible with Craft's own system emails, and we'll show how we can make use of that with Formie. We'll create two files, a layout and an index file. You can also write regular HTML if you prefer, this guide will still work regardless. 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. In MJML, enables you to assign default values for all the listed components under the tag.![]()
0 Comments
Leave a Reply. |