Open OBKF opened 2 years ago
Have you looked into running an MJML http server? You could set it up on a different server (on something like aws lambda or fly.io) and call out to it from your wagtail server
There's a bit about it in the django-mjml readme - https://github.com/liminspace/django-mjml#httpserver-mode
Adding a pure python mjml backend might be better addressed in django-mjml, looks like there's an issue about custom backends in that repo - https://github.com/liminspace/django-mjml/issues/122
@seb-b Thanks, for now, I am implementing a simple newsletter using Django forms and stuff, while researching the links you provided.
It would be nice to have a system where you design your email in an external software, like Figma or MJML designer and upload the email files as zip and use that.
Or maybe use a binary executable of the mjml package (I don't know it exists, I can't find one) instead of using Nodejs.
When looking for ways to avoid the use of Node in production environment, I found out you can use pkg to generate a binary of a given package. Then you just have to update the command path in the settings, and add the generated file to your repository so that it's available on your server too. Details here : https://github.com/mjmlio/mjml/issues/2450#issuecomment-1073716544
However, I personally think it's best to run your own http server, as @seb-b suggested.
Example of how to use your own mjml http server can also be found in Birdsong's own tests:
Birdsong uses django-mjml
and django-mjml
has a GitHub Issue in that they discuss about using mjml-python
which has no Nodejs dependency.
https://github.com/liminspace/django-mjml/issues/184
Thus, one option is contribute that issue or just wait until it is done.
I really love this plugin, It worked well on my development machine, but when I deployed it on my cpanel shared hosting it failed because their Python apps don't have access to Nodejs.
Is it possible to use some other implementation of mjml like this pure python one? Or maybe use a binary executable of the mjml package (I don't know it exists, I can't find one) instead of using Nodejs.
Thanks.