

Version 4.x of this gem brings support for MJML 4.x mjml_binary_version_supported = " 3.3.5 " end MJML v3.x & v4.x support mjml_binary = " /path/to/custom/mjml " config. validation_level = " soft " # Use custom MJML binary with custom versionĬonfig. minify = true # Render MJML templates with errorsĬonfig. raise_render_exception = false # Optimize the size of your emailsĬonfig. template_language = :haml # Ignore errors silentlyĬonfig. setup do | config | # Use :haml as a template languageĬonfig. if an old version is installed by accident. MJML-Rails checks the version of the MJML binary and fails if it does not start with this version, e.g.

This can be used to specify the path to a custom MJML binary if it is not detected automatically (shouldn't be needed). See MJML validation documentation for all possible values. This means in case of an invalid template those invalid parts will be missing from the output.

If set to soft, MJML will render invalid templates and ignore invalid parts. MJML-Rails will raise an exception on any template error by default. you have a text fallback for your emails). Read more at #34.Įxceptions will be raised and passed to your application by default.īeware that setting it to false leads to an empty html email when an exception is raised, so only set this to false if you do not rely on html (e.g. app/mailers/user_mailer.rbĬlass UserMailer in comments in your partial. Your user_mailer.rb might look like this: #. Notice you can use ERB and partials inside the template.Note: As of MJML 4.3.0 you can no longer use directly inside an, wrap it in. MJML-Rails allows you to render HTML emails from an MJML template.
