[Forminator Pro] Forminator Compatibility w/ Postmark’s Newest API Updates – 422 error

I’m using Postmark for SMTP on this site configured using the Fluent SMTP plugin. Recently, I’ve encountered some form submissions failing. And the Postmark logs indicate the following error:

{
“code”: 422,
“message”: “Error parsing ‘From’: Illegal email address ‘&amp’. It must contain the ‘@’ symbol.”,
“errors”: [
“Error parsing ‘From’: Illegal email address ‘&amp’. It must contain the ‘@’ symbol.”
]
}

After searching Postmark’s docs for more info about this 422 error, I came across this doc regarding recent API changes:

https://postmarkapp.com/updates/changes-to-email-api-validation-action-may-be-required

I wonder if Forminator’s JSON is malformed and no longer compliant with Postmark’s updated API standards/guidelines.

The article mentions:

In the past, Postmark’s email API has been pretty forgiving to requests that are passed incorrectly. In some cases, we’ve accepted invalid request headers and incorrectly passed JSON body key/value pairs—even if they didn’t match our API documentation. Going forward, we’ll start to reject invalid requests and return an error message instead.

Is this something that can be explored for remediation if the issue lies with Forminator’s handling of form submissions?

  • Patrick Freitas
    • FLS

    Hi Jon

    I hope you are doing well.

    Forminator won’t send any JSON to the integration, it triggers the wp_mail and it is up to the SMTP plugin to intercept that email and send it via the connection, so in case of any bad format, it should be related to the SMTP plugin.

    I also installed the SMTP plugin with the integration and made a couple of tests including with your forms on my lab site but didn’t have any issues:

    [attachments are only viewable by logged-in members]

    So I checked your logs and the issue is on your From Email and this isn’t from Forminator at all but from the plugin settings:

    [attachments are only viewable by logged-in members]

    But I see some success emails sent later so I believe you fixed that.

    Let us know if you still have any issues
    Best Regards
    Patrick Freitas

  • Jon
    • Site Builder, Child of Zeus

    Hey Patrick,

    Thanks for your reply. I understand the Fluent SMTP logs from the Forminator form sumissions were taking issue with the “&” symbol in the “From” name for the emails. Interestingly, without adjusting the Fluent SMTP configuration, I installed Fluent Forms and tested a form submission that went through successfully with no errors (see screenshot).

    Any successful submissions you’re seeing in the Fluent SMTP logs now are from Fluent Forms. I did also go ahead and swap the “From” name to use the word “and” instead of the “&” symbol moving forward. And you can see that reflected in more recent form test submissions (see screenshot).

    Unless you have some other insights as to what might cause this issue, it appears the use of the special character “&” is what triggered the error. But Fluent Forms didn’t have the same issue, for whatever that is worth.

  • Adam Czajczyk
    • Support Gorilla

    Hi Jon

    I hope you’re well today!

    I can’t really say for sure why Fluent Forms was not affected by this but I believe that’s because both plugins are from the same vendor and they tightly integrated with each other. I suppose that the form’s plugin may be “talking” directly to SMTP plugin in this case while Forminator uses standard WP “wp_mail()” function that’s then “intercepted” by the SMTP plugin.

    That may be making a difference.

    But I also noticed that there is still an amp character set in Forminator configuration. Since SMTP plugin is not set to “force from e-mails” there is a chance that this overrides the SMTP setting.

    So if you are still having issues with notifications from Forminator, please go to “Forminator -> Settings -> General’ page and try changing sender name there to use “and” instead of ampersand – as it may be misinterpreted by the SMTP plugin.

    Best regards,
    Adam