• Resolved Torsten Landsiedel

    (@zodiac1978)


    Hi! Your great plugin is working fine for us!

    I had some trouble to set it up correctly with piped mail addresses, but finally got it working.

    I used https://webhook.site to test my setup (as seen in your screenshots, thanks for this link BTW), and I saw one little change after I used the modified body.

    In the default set up the data comes with content-type application/json; charset=UTF-8, but after modifying the body it is sent as content-type text/plain; charset=UTF-8

    Any idea why this happens? I didn’t finally set it up with our CRM, and hopefully this does not break anything …

    Maybe this is an easy fix for you?

    All the best
    Torsten

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mário Valney

    (@mariovalney)

    Hey! How are you?

    That’s expected with how the plugin currently decides the Content-Type.

    • Default mode: it always sends application/json because it builds the body with json_encode( $data ).
    • Custom Body mode: the plugin treats your custom template as “JSON” only if it can successfully json_decode() the final rendered body. If decoding fails, it falls back to text/plain.

    So the change you’re seeing usually means: after the placeholders are replaced, the resulting body is not valid JSON (most commonly because of missing quotes, trailing commas, or unescaped line breaks).

    What to do

    1. Make sure your custom body is valid JSON after piping, e.g.:
    {
    "email": "[your-email-field]",
    "name": "[your-name-field]",
    "checkbox": [your-checkbox]
    }
    1. If your CRM requires JSON, you can also force the header in “Custom headers”, e.g.: Content-Type: application/json …but I’d only do that if you’re 100% sure the body is valid JSON, otherwise some CRMs will reject it.

    If you paste your custom body template (the one you’re using) and your form, I can quickly point out what makes it non-JSON and suggest the minimal fix.

    Thread Starter Torsten Landsiedel

    (@zodiac1978)

    Hey @mariovalney

    thanks for the fast reply!

    I don’t know why and when it happened, as I copied the data from the text field below, but I just missed the commas at the end. No idea how I missed that …

    Now it shows the correct mime type! 🙂

    Thanks for helping so fast.

    All the best
    Torsten

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.