While Laravel has its own way to render emails you will later send, I find Mustache as a better solution to the design & consistency problems:
From my personal experience, I use MJML to write mails’ design and I mix it up with Mustache code. When I’m rendering it to HTML, I save the files and I then just get their content when I’m sending the mails.
Yes, that’s pretty old for me, but if you like to do this in an automated way, check out MJML repository where you can learn how to render your MJML files or you can use the MJML API that renders it for you via a REST API.
Mustache is an engine that is able to render content based on markdown. You can assign variables and then you can later display them in your block of text, for example. We will use it to create dynamic content for your users in newsletters.
To install Mustache, open your command line or add it to your Composer dependencies:
$ composer require mustache/mustache
#mustache #dynamics #content #php #newsletter