Coder Social home page Coder Social logo

Comments (8)

ramaboo avatar ramaboo commented on September 26, 2024

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.

sighmon avatar sighmon commented on September 26, 2024

@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.

pcriv avatar pcriv commented on September 26, 2024

Any updates about this issue?

from mjml-rails.

sighmon avatar sighmon commented on September 26, 2024

@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.

pcriv avatar pcriv commented on September 26, 2024

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.

sighmon avatar sighmon commented on September 26, 2024

@pablocrivella have you tried without .slim? So just app/views/devise/mailer/reset_password_instructions.mjml but still using slim markup?

from mjml-rails.

pcriv avatar pcriv commented on September 26, 2024

@sighmon haven't tried that, i'll do that and let you know.

from mjml-rails.

ruinunes avatar ruinunes commented on September 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.