maizzle / framework

Quickly build HTML emails with Tailwind CSS.
https://maizzle.com
MIT License
1.23k stars 49 forks source link

How to compile for production with conditionals #794

Closed comatory closed 2 years ago

comatory commented 2 years ago

I intend to generate email templates for Mandrill service. They support handlebar syntax so I want my output to include this syntax. Is this possible?

I have dynamic data coming in and based on that data I want to render different components so if I build for production I would expect the output to contain all the HTML needed for those configurations.

{{#if condition === 'A'}}
    <p>Some HTLM</p>
   {{#else if condition === 'B'}}
   <p>Some other HTML</p>
  {{/if}}

Basically let the service render whatever they need. At the moment I'm using config.js file to configure some variables so I can test it on localhost but for production I'd like to have placeholders in place instead of rendered HTML.

Is there a way to automate this process? Is this supported? Thank you,

cossssmin commented 2 years ago

https://maizzle.com/docs/tags#conditionals