# Allow email created via API to be MJML

**URL:** <https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257>\
**Category:** Ideas and Feature Requests\
**Created:** [January 6, 2022, 11:40am UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257 "2022-01-06T11:40:13Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![da644](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/da644/32/4386_2.png) [@da644](https://forum.mautic.org/u/da644)\
**Post date:** [January 6, 2022, 11:40am UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/1 "2022-01-06T11:40:13Z")

</div>

**My idea is:**

At the moment, when using the API to create a new email (`/emails/new`) you only have the option to send “customHtml” and “plainText” and there is no option to send the email content as MJML. As we changed our base template from HTML to MJML for the new editor, we now have to go back to the old HTML version for an email we want to send via the API.

Therefore, either allow MJML to be sent in the “customHtml” field and interpreted or add a new field for “customMJML” to the create email API endpoint.

**I think these groups of people would benefit from this idea:**

Anyone with MJML template(s).

**Why I think they would benefit from this idea:**

They could use the same template code for both templates and emails created via the API.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 6, 2022, 4:04pm UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/2 "2022-01-06T16:04:14Z")

</div>

Hello!  
Have you tested this feature with an MJML template as base template for the API call?  
I think this is already working.  
Joey

---

<div class="post-metadata">

**Author:** ![da644](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/da644/32/4386_2.png) [@da644](https://forum.mautic.org/u/da644)\
**Post date:** [January 6, 2022, 5:55pm UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/3 "2022-01-06T17:55:06Z")

</div>

That isn’t what I mean, I meant sending an email to Mautic as “custom” MJML, like you can do with the `customHtml` field. I’ve tested this, but sending MJML in the `customHtml` field and that doesn’t work.

---

<div class="post-metadata">

**Author:** ![da644](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/da644/32/4386_2.png) [@da644](https://forum.mautic.org/u/da644)\
**Post date:** [January 6, 2022, 6:03pm UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/4 "2022-01-06T18:03:17Z")

</div>

I’ve just looked at the docs again and maybe you are thinking about the `/emails/ID/contact/CONTACT_ID/send` endpoint, to send template emails to users and not `emails/new` to _create_ a new email.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [January 10, 2022, 7:37am UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/5 "2022-01-10T07:37:08Z")

</div>

Hi,  
No, I was thinking about `/api/emails/new`, which is a way to create a new email via API.  
It does work perfectly with html, and I had the impression, I can do the same with MJML. I only have to use an mjml compatible base template in `'template'` value I’m posting with the api call.

Man, I was wrong.

I also realized the lack of understanding I have for MJML templates. Only the “translated” html is stored in the `emails.custom_html`, the actual mjml code is in `bundle_grapesjs.custom_mjml`.

In order to make this happen, we would need to ‘inject’ the code right here via API and run the translator to create a html version of that mjml on the fly.

Joey

---

<div class="post-metadata">

**Author:** ![jonnitto](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/jonnitto/32/8251_2.png) [@jonnitto](https://forum.mautic.org/u/jonnitto)\
**Post date:** [September 9, 2022, 9:03am UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/6 "2022-09-09T09:03:11Z")

</div>

Hi there, is there any progress on this?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 9, 2022, 9:21am UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/7 "2022-09-09T09:21:54Z")

</div>

Nope, still only HTML.

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [May 12, 2023, 7:06am UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/8 "2023-05-12T07:06:27Z")

</div>

Still confirmed not working with mjml :-(.

---

<div class="post-metadata">

**Author:** ![entrepositive](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/entrepositive/32/9645_2.png) [@entrepositive](https://forum.mautic.org/u/entrepositive)\
**Post date:** [November 15, 2024, 10:25pm UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/9 "2024-11-15T22:25:19Z")

</div>

This is bumming me out that this hasn’t been implemented.

It’s like Mautic grew two extra arms but they forgot to give them thumbs.

We’re 90% of the way there, let’s go the extra 10% or?

How can we make this happen?

@joeyk @mikew @jonnitto @da644  
Might as well ping @mzagmajster as well 🕶

---

<div class="post-metadata">

**Author:** ![entrepositive](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/entrepositive/32/9645_2.png) [@entrepositive](https://forum.mautic.org/u/entrepositive)\
**Post date:** [November 15, 2024, 10:31pm UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/10 "2024-11-15T22:31:23Z")

</div>

If I’m understanding you correctly, the Mautic API receives the MJML code but is not able to transport it correctly into the MJML template. Is that correct?

I can easily “translate” MJML to HTML, even GPT can do this quite easily in-line in automation workflow, and send to API. But then the limitations of HTML come to life, and defeats the purpose of MJML altogether.

How did [Chimpino](https://chimpino.com/ai-plugin/) make this app? This actually works as we’re discussing here, although it erases any existing content and rebuilds from empty template, injecting the generated copy into the template. It does however work with MJML.

Might be a starting point? Maybe @escopecz has thoughts… 🤔

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [November 17, 2024, 12:52pm UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/11 "2024-11-17T12:52:48Z")

</div>

Watch this space… coming soon

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [November 18, 2024, 8:13am UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/12 "2024-11-18T08:13:37Z")

</div>

Really? Meaning yo are developing it?

---

<div class="post-metadata">

**Author:** ![entrepositive](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/entrepositive/32/9645_2.png) [@entrepositive](https://forum.mautic.org/u/entrepositive)\
**Post date:** [November 18, 2024, 4:19pm UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/13 "2024-11-18T16:19:38Z")

</div>

I’ll help anyway I can, just let me know. I’m “all hands and no thumbs” with a lot of this dev stuff, but if you need a solution that’s more like the proverbial slap and less like surgery, you know where to ask.

---

<div class="post-metadata">

**Author:** ![entrepositive](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/entrepositive/32/9645_2.png) [@entrepositive](https://forum.mautic.org/u/entrepositive)\
**Post date:** [November 20, 2024, 8:50pm UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/14 "2024-11-20T20:50:12Z")

</div>

The suspense is killing me. 🤔 😅 @mikew

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [March 24, 2025, 9:42am UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/15 "2025-03-24T09:42:01Z")

</div>

Hi All,

We have released a version for Mautic4.x and Mautic 5 for the moment.  
First 10 purchases are totally free with code MCF-MJML, released on [mailertizer](https://mailertizer.com/product/mjml-api-plugin/)

---

<div class="post-metadata">

**Author:** ![entrepositive](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/entrepositive/32/9645_2.png) [@entrepositive](https://forum.mautic.org/u/entrepositive)\
**Post date:** [April 2, 2025, 8:11pm UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/16 "2025-04-02T20:11:03Z")

</div>

You’re the man, Mike! 😎

---

<div class="post-metadata">

**Author:** ![damike](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/damike/32/13311_2.png) [@damike](https://forum.mautic.org/u/damike)\
**Post date:** [June 19, 2025, 12:19pm UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/17 "2025-06-19T12:19:29Z")

</div>

Hey folks, any news on this one? I am kind of desperatly trying to create emails via API but in mjml format. I can create them as HTML but found no way (still) to push mjml code into an email and also faking html and updating the builder with mjml is a dead end.  
I am just wondering why there was not progress so far (or I did not find a solution) after the decision was made switching to MJML…I mean it sounds like a logic consequence making it accessible for API creation as well…

Are there any plans in sight or any ideas on that topic?  
Even it of was creating a “blank email” in the correct mjml Builder would be a usable solution so that I can create the email itself and copy/paste the mjml in one go in the builder…  
help 😃

---

<div class="post-metadata">

**Author:** ![drmarky](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/drmarky/32/13380_2.png) [@drmarky](https://forum.mautic.org/u/drmarky)\
**Post date:** [December 11, 2025, 1:04pm UTC](https://forum.mautic.org/t/allow-email-created-via-api-to-be-mjml/22257/18 "2025-12-11T13:04:17Z")

</div>

Hi @damike (and everyone else following this thread),

I faced the exact same frustration. We needed to automate email creation via API, but sending raw HTML broke the ability to edit the email later in the visual builder, and there was no clean way to push the MJML source.

So, I decided to build an open-source solution for this.

I just released the **Mautic MJML API Plugin**. It adds a new API endpoint that:

1. Accepts your MJML code directly.

2. Automatically compiles it to HTML (using the system’s MJML binary or Node).

3. **Crucially:** It injects the MJML source into the GrapesJS builder tables. This means you can create the email via API, and then open it in the Mautic UI and continue editing it visually without losing any data.

It works with Mautic 4.x and 5.x.

You can grab it for free here:  
👉 **[https://github.com/drMarkySlo/mautic-mjml-api-plugin](https://www.google.com/url?sa=E&q=https%3A%2F%2Fgithub.com%2FdrMarkySlo%2Fmautic-mjml-api-plugin)**

I’d love to hear your feedback if you give it a try!
