-
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add ability to use markdown templates #15
Comments
Hey @watzon! 👋 I don't think adding a built-in Markdown support is a great idea. This would mean we choose to use Markdown over other simple text engine (like Asciidoc - that we heavy use in our documentation). Why not make the Concerning the idea of having built-in components I also think it'd be better to have a community package that handles that. Then you could simply install it and use it with a syntax like the code below. @component('@myPackage::mail.button', url = {{ order.viewUrl }})
View Order
@endcomponent (A similar syntax was proposed on the 4.0 Roadmap - section adonis-translator (new)) |
@RomainLanz I think making the |
Also, using community package instead of having built-in components will let the community create many packages with many designs (Material, Bootstrap, Foundation, Semantic-UI, etc.). Same goes for |
I like that idea |
Cool, let's wait to see the opinion of @thetutlage on this. |
So Adonis mail doesn't have any idea on how the view engine works, it just uses Edge. My plan is to let users add preprocessors to Edge, so it will be like this Raw edgeconst edge = require('edge.js')
edge.use('mail/*.edge', function (content) {
// return parsed content
}) In Adonisconst View = use('View')
View.use('mail/*.edge', function (content) {
// return parsed content
}) |
This issue was moved to edge-js/edge#13 |
Laravel gives us the ability to have blade templates that take blade/markdown and turn it into an HTML email template. This saves some major headache when it comes to making emails beautiful and responsive. It would be awesome if Adonis had the same functionality.
Proposal
Add a markdown method to the Mailer and some built in components that get added to edge templates. Developers should ideally be able to use the markdown method to render an edge template, or send plain markdown which will be parsed into valid email HTML before being sent.
Example Code
Reference
https://laravel.com/docs/5.5/mail#markdown-mailables
https://www.npmjs.com/package/markdown
https://www.npmjs.com/package/markdown-it
The text was updated successfully, but these errors were encountered: