Giter Site home page Giter Site logo

Comments (5)

yourcelf avatar yourcelf commented on August 11, 2024 1

mjml doesn't distinguish between error level ("errors" vs "warnings"), but with default options it is possible to have both errors and html output in the compiled result.

mjml2html does accept an options argument which could include {validationLevel: "strict"}, which causes it to throw an exception on the presence of any error - so that's another approach that could be taken to ensure that errors are thrown, rather than inspecting the errors array.

For my use case, I'd much prefer get an exception and not send an email if there's any possibility the email rendering was incomplete, even if it did render with warnings. In my setup now I'm running with my own version of tcpserver.js to get that behavior, so it isn't a burden to me if you think it better for django-mjml to have a more lax setup.

from django-mjml.

liminspace avatar liminspace commented on August 11, 2024

Thanks @yourcelf,
mjml 4 hasn't released yet (it's just beta now), so I haven't check it yet.
I'll update django-mjml to support mjml 4 soon but just in separated branch, not master.

from django-mjml.

yourcelf avatar yourcelf commented on August 11, 2024

Apologies for my lack of clarity. This impacts mjml >= 3, not just v4+. I'm currently using 3.3.5, I expect anything in major version 3 will be affected (though I haven't checked earlier point releases).

from django-mjml.

liminspace avatar liminspace commented on August 11, 2024

OK, I'll add mjml's errors checking.
But what about some warning messages in errors field? Is it possible if there is a rendered template and some errors together?

from django-mjml.

liminspace avatar liminspace commented on August 11, 2024

@yourcelf, this issue is done in next release 0.5.0. Now you can check it in develop branch. Just set up mjml option level/validationLevel with strict value, see readme.

from django-mjml.

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.