Comments (9)
@hugogiraudel @pgoetze Oh right, in foobar_mailer.rb
try this:
# ./app/mailers/foobar_mailer.rb
class FoobarMailer < ActionMailer::Base
def baz()
mail(to: '[email protected]', subject: 'test') do |format|
format.text
format.mjml
end
end
end
I'll add that to the README if it solves your problem.
from mjml-rails.
Hey, it seems to work, thanks!
Do you have any idea why a partial render does not crash but outputs nothing?
<%= render partial: 'need_link' %>
Also tried:
<%= render 'need_link' %>
Also tried:
<%= render partial: 'need_link', formats: [:mjml] %>
The partial does not print anything. :(
from mjml-rails.
My bad, the formats should be [:html]
. I misread the docs. Thanks! :x
from mjml-rails.
@hugogiraudel glad it's working for you now. Feel free to make improvements. :-)
from mjml-rails.
I had the exact opposite problem as OP. 😄
When I write
mail to: '[email protected]', subject: 'test' do |format|
format.text
format.mjml
end
Rails can't find the template. When I just write mail to: '[email protected]', subject: 'test'
it works fine. Maybe a change in a recent version? I'm on v2.2.0.
from mjml-rails.
@manuelmeurer that's a known bug we're trying to find an elegant solution for at the moment. @thatpixguy has an ugly hack that gets around it for now.. did you want to post that here Pix?
Just out of interest, what folder are your views in @manuelmeurer ?
from mjml-rails.
I put my views in a mailers
folder, maybe that's the issue?
class ApplicationMailer < ActionMailer::Base
def self.inherited(subclass)
subclass.default template_path: "mailers/#{subclass.name.to_s.underscore}"
end
end
from mjml-rails.
@manuelmeurer @hugogiraudel Try this and let me know how you get along:
lookup_context.view_paths = ["test/views/template_subdir"]
mail( to: '[email protected]', subject: 'test' ) do |format|
format.text
format.mjml
end
from mjml-rails.
Well, I'm actually happy with the way it works right now (without needing the block at all). 😄
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.