0

According to documentation I am able to receive a letter with error message in case of sending issues, for example in case broken template expression. To my request I added all necessary fields:

           "TemplateErrorReporting": {
                "Email": "recipient@gmail.com",
                "Name": "recipient name"
            }

I added a mistake to template and send the letter via API:

 client = new MailjetClient(mj_apikey_public, System.getenv("MJ_APIKEY_PRIVATE"), new ClientOptions("v3.1"));
    request = new MailjetRequest(Emailv31.resource)
            .property(Emailv31.MESSAGES, new JSONArray()
                    .put(new JSONObject()
                            .put(Emailv31.Message.FROM, new JSONObject()
                                    .put("Email", "service@test.test")
                                    .put("Name", "Mailjet error handling testing"))
                            .put(Emailv31.Message.TO, new JSONArray()
                                    .put(new JSONObject()
                                            .put("Email", "dmytro.parkhomenko@test.test")
                                            .put("Name", "passenger 1")))
                            .put(Emailv31.Message.TEMPLATEID, 66638587)
                            .put(Emailv31.Message.TEMPLATELANGUAGE, true)
                            .put(Emailv31.Message.SUBJECT, "Mailjet error handling testing subject")
                            .put(Emailv31.Message.TEMPLATEERROR_DELIVERY, false)
                            .put(Emailv31.Message.TEMPLATEERROR_REPORTING, new JSONObject()
                                    .put("Email", "recipient@gmail.com")
                                    .put("Name", "recipient name"))));
    response = client.post(request);

As a result I did not receive a letter from templating-language-error@mailjet.com as expected, so templates error management is not working for me.

Dimon
  • 763
  • 3
  • 7
  • 22

1 Answers1

1

Mailjet used to have issues during the time when this thread was created. Those were related to Error Reporting triggers, which should now be resolved and you would no longer experience that one again.

Double check and update the thread once you have the time so to know.

Krass
  • 86
  • 1
  • 7