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

mjml creation throws error in mailjet ui #311

Open
nadar opened this issue Nov 5, 2024 · 6 comments
Open

mjml creation throws error in mailjet ui #311

nadar opened this issue Nov 5, 2024 · 6 comments

Comments

@nadar
Copy link

nadar commented Nov 5, 2024

Hi Mailjet Developer Team,

For the past two weeks, emails created through the API using an MJML template have stopped working. Unfortunately, support has not provided any solutions, only requesting more information that doesn’t seem relevant to the issue.

The same problem appeared about a month ago, was resolved by Mailjet, but has now returned.

We haven’t made any changes on our end, and our unit tests confirm that the MJML remains consistent. This strongly suggests the issue is on Mailjet's side.

Here is an example request (with some unnecessary details removed):

$body = [
    'Name' => $title,
    'Description' => $description,
    'EditMode' => 4,
    'IsStarred' => true,
    'IsTextPartGenerationEnabled' => true,
    'OwnerType' => 'apikey',
    'Purposes' => ['marketing'],
    'Categories' => ['newsletter'],
];

$response = $this->getClient()->post(Resources::$Template, ['body' => array_filter($body)]);
$id = $response->getData()[0]['ID'];

$body = [
    'Headers' => [
        'Subject' => $title,
    ],
    'MJMLContent' => $mjml,
];

$this->getClient()->post(Resources::$TemplateDetailcontent, ['id' => $id, 'body' => $body]);

example mjml content or any other template from mjml.io

<mjml> <mj-body> <mj-section> <mj-column> <mj-text font-size="20px" color="#F45E43" font-family="helvetica">foobar!</mj-text> </mj-column> </mj-section> <mj-section> <mj-column> <mj-text>Hello World</mj-text> <mj-text>This is a teaser</mj-text> </mj-column> </mj-section> <mj-section> <mj-column> <mj-text>Hello World 2</mj-text> <mj-text>This is a teaser 2</mj-text> </mj-column> </mj-section> </mj-body> </mjml>
@oleksandr-mykhailenko
Copy link
Collaborator

Hello @nadar
We are working on that. For now we do not see any issues from the library code, but anyway, we are working. Because it could be related to another server part

@nadar
Copy link
Author

nadar commented Nov 7, 2024

Yes i am aware its not the client library, but the support does not answer or takes care of the problem. So i thought a discussion between developers might help, its urgent, and persists since two weeks, the 500xhr exception should be in your error tracking system ;-)

Error from the UI

image

500-er response:

image

@nadar
Copy link
Author

nadar commented Nov 7, 2024

The "htmlPart" is not part of the request, when we use "MJMLContent" - so the request will not have htmlPart variable and for whatever reason the request requires this, based on the exception from the ui :-)

@oleksandr-mykhailenko
Copy link
Collaborator

Oh, that's not good. So we are working on it. Looks like a lack of API docs and library right now (

@nadar
Copy link
Author

nadar commented Nov 13, 2024

Any news @oleksandr-mykhailenko on this? It seems Mailjet really don't care about.

@oleksandr-mykhailenko
Copy link
Collaborator

Any news @oleksandr-mykhailenko on this? It seems Mailjet really don't care about.

Unfortunately, for now I do not have any updates. Testing wrapper with php 8.2 and 8.3 give same results. For some reason, server side does something with the data. It looks like that, but can't be sure. What I can say for sure, we are working on that and keep testing

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

No branches or pull requests

2 participants