Comments (8)
I have similar issues. The handling of templates in this gem is all wrong. For example something.mjml.slim should work so should something.mjml.slim.erb. Rails is supposed to chain templates where each one renders and passes it down the line. Somehow though this gem does not do that correctly. I have been fighting with it for awhile now :(
from mjml-rails.
@raderj89 @ramaboo I'm short of time at the moment, so if either or both of you would like to propose a fix and submit a pull request that'd be great! :-)
from mjml-rails.
Any updates about this issue?
from mjml-rails.
@pablocrivella Could you post some sample code of your controller/mailers, views, where they sit in your filesystem, and the errors. Thanks!
from mjml-rails.
I'm using it to style devise mailers, so my code is exactly like this.
I normally use slim
on all my views, so i tried to make this:
app/views/devise/mailer/reset_password_instructions.mjml.slim
But that throws an exception
from mjml-rails.
@pablocrivella have you tried without .slim? So just app/views/devise/mailer/reset_password_instructions.mjml
but still using slim markup?
from mjml-rails.
@sighmon haven't tried that, i'll do that and let you know.
from mjml-rails.
In order to use haml templates, I've added an initializer file, specifying template_language
:
Mjml.setup do |config|
config.template_language = :haml
end
This allows to deliver an email for a filename as some_template.mjml
, coded using haml syntax. This is not very optimal, as code editors won't highlight the haml syntax, if the last chain extension is .mjml
.
Calling the some_template.mjml.haml
, will highlight the haml syntax on an editor, but the email will be delivered as text.
from mjml-rails.
Related Issues (20)
- Update GitHub actions
- [Bug] Does not find MJML executable with npm 9+ (yarn 2+ uses npm discovery) HOT 2
- Slow to render layout, and too much object(memory) Allocations HOT 1
- Prevents booting when `which` is missing HOT 8
- Can i override a layout? HOT 1
- How to custom template path? HOT 1
- Add config option for fonts HOT 1
- Fix test pipeline for Ruby 2.7
- Warning about MJML missing when using MRML HOT 5
- Database template support HOT 1
- What node packages need to make it working properly? HOT 1
- unable to load included template when using MRML HOT 3
- Support JSON MJML templates HOT 1
- Support variables as used in Mailjet HOT 6
- Fix tests
- RuboCop? HOT 2
- `Mjml::Parser#render` suppresses errors in case of Tempfile exceptions HOT 2
- Exit code in case of an error when calling the mjml binary HOT 3
- SIGKILL (signal 9) on many concurrent emails HOT 3
- How to use this library to generate a string of raw html? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mjml-rails.