mjmlio / mjml

MJML: the only framework that makes responsive-email easy
https://mjml.io
MIT License
17.08k stars 960 forks source link

MJML Java client #686

Closed ed0906 closed 7 years ago

ed0906 commented 7 years ago

I can already build/modify an MJML document using java libraries such as JSOUP, is there an easy way I can then compile to a HTML within java?

I guess this is a feature request really.

ngarnier commented 7 years ago

Hey @ed0906, you'd have to create a Java wrapper around the NodeJS MJML engine.

However, what about using the MJML API? You can POST a MJML string and get the responsive HTML in return.

ed0906 commented 7 years ago

@ngarnier I'll have a look at both approaches (the second seems fairly simple) and get back to you

ngarnier commented 7 years ago

Hey @ed0906, which route did you decide to take?

ed0906 commented 7 years ago

@ngarnier I went with the second approach and wrote a slim java wrapper around the MJML Web API that anyone can use with a valid AppID & Key: https://github.com/ed0906/mjml4j Feel free to critique 😃

It looked like I'd need to spin up a NodeJS server and call it locally (basically create my own local web API) to go with the first approach and do it all locally. I figured it made more sense to use the API you guys manage, especially as it's free 😃.

You can override the host with that wrapper though so it should give people options.

ngarnier commented 7 years ago

Ha awesome! I'm closing this issue then 😄

ed0906 commented 7 years ago

@ngarnier Feel free to add this to: https://mjml.io/community if you feel its appropriate 😃