{"id":37419874,"url":"https://github.com/digitalfondue/mjml4j","last_synced_at":"2026-01-16T06:05:29.142Z","repository":{"id":223176228,"uuid":"759481435","full_name":"digitalfondue/mjml4j","owner":"digitalfondue","description":"Java implementation for MJML - a framework that makes responsive-email easy","archived":false,"fork":false,"pushed_at":"2026-01-11T22:12:58.000Z","size":334,"stargazers_count":34,"open_issues_count":5,"forks_count":5,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-01-11T23:56:04.220Z","etag":null,"topics":["email","email-boilerplate","java","mjml","responsive","responsive-email","templating-engine"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitalfondue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-18T17:56:46.000Z","updated_at":"2026-01-02T07:41:55.000Z","dependencies_parsed_at":"2024-06-16T17:26:51.708Z","dependency_job_id":"64a1d35c-b881-46f9-9ce9-021de0601cea","html_url":"https://github.com/digitalfondue/mjml4j","commit_stats":null,"previous_names":["digitalfondue/mjml4j"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/digitalfondue/mjml4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalfondue%2Fmjml4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalfondue%2Fmjml4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalfondue%2Fmjml4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalfondue%2Fmjml4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalfondue","download_url":"https://codeload.github.com/digitalfondue/mjml4j/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalfondue%2Fmjml4j/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["email","email-boilerplate","java","mjml","responsive","responsive-email","templating-engine"],"created_at":"2026-01-16T06:05:29.020Z","updated_at":"2026-01-16T06:05:29.131Z","avatar_url":"https://github.com/digitalfondue.png","language":"Java","readme":"# MJML4J\n\nA java based [mjml](https://mjml.io/) implementation.\n\nRequire at least java 17.\n\nJavadoc: https://javadoc.io/doc/ch.digitalfondue.mjml4j/mjml4j\n\n# Why\n\nAs far as I know, there is no pure java version of mjml. This library is quite compact with a single dependency - the [html5 parser (jfiveparse)](https://github.com/digitalfondue/jfiveparse).\n\n# License\n\nmjml4j is licensed under the MIT License.\n\nThe code is based on the following projects:\n\n - https://github.com/mjmlio/mjml/\n - https://github.com/SebastianStehle/mjml-net\n - https://github.com/LiamRiddell/MJML.NET\n\n# Status\n\nMost of the mj-* tags are supported. It's currently missing:\n\n - ~~mj-include: will be implemented~~ implemented in 1.1.1\n - mj-style: the inline attribute will be ignored: will be supported when the work on css selector support is done. WIP\n - mj-html-attributes: will be supported when the work on css selector support is done. WIP\n\nAdditionally, no pretty print/minimization of the output is provided.\n\n# Download\n\nmaven:\n\n```xml\n\u003cdependency\u003e\n   \u003cgroupId\u003ech.digitalfondue.mjml4j\u003c/groupId\u003e\n   \u003cartifactId\u003emjml4j\u003c/artifactId\u003e\n   \u003cversion\u003e1.1.5\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\ngradle:\n\n```\nimplementation 'ch.digitalfondue.mjml4j:mjml4j:1.1.5'\n```\n\n# Use\n\nIf you use it as a module, remember to add `requires ch.digitalfondue.mjml4j;` in your module-info.\n\nThe api is quite simple:\n\n```java\npackage ch.digitalfondue.test;\n\nimport ch.digitalfondue.mjml4j.Mjml4j;\n\npublic class App {\n   public static void main(String[] args) {\n      Mjml4j.Configuration configuration = new Mjml4j.Configuration(\"en\");\n      String renderedTemplate = Mjml4j.render(\"\"\"\n              \u003cmjml\u003e\n                \u003cmj-body\u003e\n                  \u003cmj-section\u003e\n                    \u003cmj-column\u003e\n                                      \n                      \u003cmj-image width=\"100px\" src=\"/assets/img/logo-small.png\"\u003e\u003c/mj-image\u003e\n                                      \n                      \u003cmj-divider border-color=\"#F45E43\"\u003e\u003c/mj-divider\u003e\n                                      \n                      \u003cmj-text font-size=\"20px\" color=\"#F45E43\" font-family=\"helvetica\"\u003eHello World\u003c/mj-text\u003e\n                                      \n                    \u003c/mj-column\u003e\n                  \u003c/mj-section\u003e\n                \u003c/mj-body\u003e\n              \u003c/mjml\u003e\n              \"\"\", configuration);\n      System.out.println(renderedTemplate);\n   }\n}\n```\n\nThe `render` static method accept as a parameters:\n1) a string which will be then parsed and processed by the [html5 parser (jfiveparse)](https://github.com/digitalfondue/jfiveparse), or it can accept a `org.w3c.dom.Document` \n2) a configuration object with language, optionally a direction and an [IncludeResolver](https://javadoc.io/doc/ch.digitalfondue.mjml4j/mjml4j/latest/ch.digitalfondue.mjml4j/ch/digitalfondue/mjml4j/Mjml4j.IncludeResolver.html)\n\n\n## mj-include support\n\nBy default, mjml4j don't have an [IncludeResolver](https://javadoc.io/doc/ch.digitalfondue.mjml4j/mjml4j/latest/ch.digitalfondue.mjml4j/ch/digitalfondue/mjml4j/Mjml4j.IncludeResolver.html) configured, thus `mj-include` will not work out of the box, you must implement or specify yourself.\nmjml4j offer 2 implementations:\n - [FileSystemResolver](https://javadoc.io/doc/ch.digitalfondue.mjml4j/mjml4j/latest/ch.digitalfondue.mjml4j/ch/digitalfondue/mjml4j/Mjml4j.FileSystemResolver.html) if your resources are present on the filesystem\n - [SimpleResourceResolver](https://javadoc.io/doc/ch.digitalfondue.mjml4j/mjml4j/latest/ch.digitalfondue.mjml4j/ch/digitalfondue/mjml4j/Mjml4j.SimpleResourceResolver.html) a resolver that need a [ResourceLoader](https://javadoc.io/doc/ch.digitalfondue.mjml4j/mjml4j/latest/ch.digitalfondue.mjml4j/ch/digitalfondue/mjml4j/Mjml4j.ResourceLoader.html) to be implemented\n\n# Development notes:\n - the project has a java 17 baseline\n - the code is formatted using the maven spotless plugin. Use `mvn spotless:apply` to format it\n\n# TODO:\n - validation api:\n   - add \"parent element\" check\n   - attribute unit type check\n - improve the renderer\n - cleanup/rewrite the box model, kinda hacky\n - more robust handling of invalid input (check mjml behaviour)\n - check differences/import tests\n \n \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalfondue%2Fmjml4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalfondue%2Fmjml4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalfondue%2Fmjml4j/lists"}