https://github.com/mquy/phoenix_mjml
Phoenix Template Engine for Mjml
https://github.com/mquy/phoenix_mjml
elixir-lang mjml phoenix-framework
Last synced: 11 months ago
JSON representation
Phoenix Template Engine for Mjml
- Host: GitHub
- URL: https://github.com/mquy/phoenix_mjml
- Owner: MQuy
- License: mit
- Created: 2017-03-11T08:22:06.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-10-05T07:52:33.000Z (over 4 years ago)
- Last Synced: 2025-07-11T19:44:19.668Z (12 months ago)
- Topics: elixir-lang, mjml, phoenix-framework
- Language: Elixir
- Homepage:
- Size: 17.6 KB
- Stars: 40
- Watchers: 3
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Phoenix Template Engine for Mjml
[![License][deps-img]][deps]
[![License][license-img]][license]
> Powered by [Mjml](https://mjml.io/)
## Usage
1. Add `{:phoenix_mjml, "~> 0.2.1"}` to your deps in `mix.exs`.
If you generated your app from the Phoenix master branch,
add phoenix_mjml's master branch to your deps instead.
`{:phoenix_mjml, github: "chrismccord/phoenix_mjml"}`
2. Add the following to your Phoenix `config/config.exs`
```elixir
config :phoenix, :template_engines,
mjml: PhoenixMjml.Engine
```
3. Use the `.html.mjml` extensions for your templates.
## Optional
Add mjml extension to Phoenix live reload in `config/dev.exs`
```elixir
config :hello_phoenix, HelloPhoenix.Endpoint,
live_reload: [
patterns: [
~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$},
~r{web/views/.*(ex)$},
~r{web/templates/.*(eex|mjml)$}
]
]
```
## License
MIT license. Please see [LICENSE][license] for details.
[deps-img]: https://beta.hexfaktor.org/badge/all/github/dailydrip/firestorm.svg
[deps]: https://beta.hexfaktor.org/github/dailydrip/firestorm
[license-img]: http://img.shields.io/badge/license-MIT-brightgreen.svg
[license]: http://opensource.org/licenses/MIT
[LICENSE]: https://github.com/MQuy/phoenix_mjml