Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]: mjml as api service #340

Closed
liminspace opened this issue Jul 24, 2016 · 29 comments
Closed

[Feature request]: mjml as api service #340

liminspace opened this issue Jul 24, 2016 · 29 comments

Comments

@liminspace
Copy link

Hi!
I use mjml and python/django by command mjml and pipe-line for pass template and get result.
It is very simple but very slow -- 0.8 - 2 seconds.
https://github.com/liminspace/django-mjml/blob/master/mjml/tools.py#L9

Then I try make tcp-server for keep mjml instance in process and I get better speed -- 0.1-0.2 seconds.
https://github.com/liminspace/django-mjml/blob/master/mjml/node/tcpserver.js

I am not good in node.js, so I propose you make mjml-api-server that other non-node.js services can use it as fast as possible.

@liminspace liminspace changed the title mjml as api service [Feature request]: mjml as api service Jul 24, 2016
@ngarnier
Copy link
Member

ngarnier commented Aug 2, 2016

hey @liminspace, thanks for posting this issue. We totally agree with you and are working on it, we're doing our best to deliver a MJML API as fast as possible!

We'll keep you updated.

@rogierslag
Copy link
Contributor

rogierslag commented Nov 22, 2016

We have implemented this as http://github.com/inventid/maily

@ngarnier
Copy link
Member

ngarnier commented Jan 4, 2017

Hey guys (cc @liminspace, @cheacase, @caymanlad, @ipa1981, @encolpe), cool update for you here! We're opening the beta for the MJML API, here is a short typeform to request access: https://mjml.typeform.com/to/tW2U6K :-). Have fun!

@encolpe
Copy link

encolpe commented Feb 6, 2017

Very nice and convenient.

@ngarnier
Copy link
Member

Hello guys, as we released the API in Public Beta today (https://mjml.io/api), I'm closing this!

Thanks and hope you'll like it :)

@ghost
Copy link

ghost commented Feb 14, 2017 via email

@ngarnier
Copy link
Member

Hey @caymanlad, sorry but we can't expose the internals of the API :(

@ghost
Copy link

ghost commented Feb 14, 2017

Hey @ngarnier, perhaps (in due course) you may reconsider allowing people to download the API and host it internally on their own servers? I work with a lot of companies where they would love to send better styled internal emails and using a cloud hosted API would not be an option for them considering the contents of these emails internal only emails (e.g. password reset for internal application, email notification about changes within an internal application etc.).

@ngarnier
Copy link
Member

ha ok I see, we'll keep that in mind then. And as they want to host it themselves, running MJML on a NodeJS server themselves is not an option either?

@ghost
Copy link

ghost commented Feb 14, 2017

If the reward for setting up a NodeJS server is that the client will have a better styled email, I suspect a lot of people would be willing to learn about what's required to stand one up.

@ipa1981
Copy link

ipa1981 commented Feb 15, 2017

Agree with @caymanlad . We use MJML CLI, but we would really consider using MJML service + API to process emails just for much better performance running on localhost. For our client (the bank) processing such emails on 3rd party server is no go due to security policy.

@ed0906
Copy link

ed0906 commented May 27, 2017

@ngarnier Is the typeform registration working?
I've applied for a key twice and had no email response :(

@ngarnier
Copy link
Member

ngarnier commented May 27, 2017 via email

@predragbabic
Copy link

I've applied for open beta, didn't receive email with credentials (I tried to apply twice), should I wait for it or? Is there a problem with open beta registration...

@ngarnier
Copy link
Member

hey @predragbabic, I just created your account on the API, you should have received them now :)

@majkoll
Copy link

majkoll commented Sep 15, 2017

@ngarnier, I tried to apply for the open beta api but haven't received any email either (as predragbabic). Can you help me out?

@ed0906
Copy link

ed0906 commented Sep 15, 2017

@majkoll I had the same issue, they have a Slack channel that you can give them a prod on if you dont get a response :)

https://slack.mjml.io/

@majkoll
Copy link

majkoll commented Sep 15, 2017

Thanks for the info @ed0906. Just joined the channel

@ngarnier
Copy link
Member

Hey guys, when you fill and submit the form, you're just applying for the beta. We'll then create the credentials manually, so you just have to be a little patient 🙂

@creativenoobie
Copy link

@ngarnier @iRyusa @robink @loeck @GuillaumeBadi @meriadec @arnaudbreton @epayet

+1 to @caymanlad & @ipa1981.
Hosting API on self-hosted server will promote privacy.
Also, MJML claims to be an open source project, It makes sense to release the API source code.

@ngarnier
Copy link
Member

wow. I just created your keys @creativenoobie. Please avoid pinging the entire world next time you need help and can't wait, one comment is enough.

MJML is open source, you can see the source code on that very same repo you're commenting, as well as the license.

About the API source code, you probably wouldn't use it because it includes complexity layers that we need as we provide it as a service (free by the way). However, I doubt you would like to run services and databases to handle credentials management, user management, databases, load balancers, communication between different languages, etc etc.

@creativenoobie
Copy link

@ngarnier

Thanks for the keys.

@liminspace
Copy link
Author

liminspace commented Jan 10, 2018

@creativenoobie you can use your own API-service, it is not too difficult do write it by yourself. For example, I use my own solution based on TCP-server and it works very well on production. Code is here https://github.com/liminspace/django-mjml/blob/master/mjml/node/tcpserver.js
You can run several process on different port to balance the load and use random one in your client.

@anand-gopinath
Copy link

anand-gopinath commented Mar 21, 2018

@ngarnier Just got the Keys via mail. Could you please give me an example to use the same credentials on CURL as well as in Postman API request?
2323

@ed0906
Copy link

ed0906 commented Mar 21, 2018

@anand-gopinath See https://mjml.io/api/documentation/

e.g.
curl -X POST \ https://api.mjml.io/v1/render \ -H 'Authorization: Basic XXXXXXX' \ -d '{ "mjml": "<mjml><mj-body><mj-container><mj-section><mj-column><mj-text>Hello World!</mj-text></mj-column></mj-section></mj-container></mj-body></mjml>" }'

@krzysztofjablonski
Copy link

Hey guys,

I did mjml-server npm package that I use in production. It speeded up parsing single email from about 800ms to 5ms. Take a look - maybe it will work for you too.

github: https://github.com/Siepomaga/mjml-server
npm: https://www.npmjs.com/package/mjml-server

@danihodovic
Copy link

danihodovic commented Jul 15, 2019

Another mjml server implementation here: https://github.com/danihodovic/mjml-http-server

@florentdestremau
Copy link

Hey guys,

I did mjml-server npm package that I use in production. It speeded up parsing single email from about 800ms to 5ms. Take a look - maybe it will work for you too.

github: https://github.com/Siepomaga/mjml-server
npm: https://www.npmjs.com/package/mjml-server

this saved me today, I even made a pull request to update some things

@dubcanada
Copy link

There is a free sponsored mjml api at http://mjml.dev if anyone needs one.

I am the one who maintains it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests