VERY new here, is this an amateur question re: The operation failed with an error. [400] Invalid Form Body

Hey there

I’m extremely new here, I’m an IT professional but it’s my first time using a tool like this. I’m trying to have a simple automation that reads a folder in my mailbox, and then posts the content of that email to a Discord Channel.

It works if I select just the Subject of the Email to send into the Discord channel, but If I use the prebuilt “Body Content” variable I get “The operation failed with an error. [400] Invalid Form Body”

I try to pride myself on RTFM and unpacking the error. Is it because Discord can’t bring in HTML Body content? I tried to convert it to UTF-8 or parse it all to text but the emails I want in the discord channel will always have a lot of HTML so I’m trying to keep the integrity of the email

Hi @markdavidboyd,

Welcome to the Make Community! Could you enable the advanced settings of the module, and see if this solution works for you? [Discord] [Send Message to Channel] [400] Invalid Form Body

I am not sure if Discord accepts HTML as input, you could try to omit the HTML with the function following function, which removes all HTML tags from text.

stripHTML (input)
f.e.
stripHTML(<b>Hello</b>)
= Hello

Please, follow these steps when asking a question, and you’ll be more likely to get a helpful answer:

:writing_hand: Give us a detailed explanation of what you’re trying to achieve

:footprints: Tell us about any steps you’ve tried so far

:camera_flash: Include screenshots of:

  • your scenario flow and setup (functions, mappings, variables, etc.)

  • module configurations and outputs

  • any error messages you are getting

:card_file_box: Share the blueprint of the scenario you are asking a question about. (this does not contain any connection or personal information)

Henk
Certified Make Expert and Partner
Book a consult with me

1 Like

Thanks so much! I didn’t have the UUID/or any details in the message reference so that bit was covered :slight_smile:

For the stripHTML bit (forgive the total Newbie question) is that a custom function i’d place between The 365 email and discord connection?

Hi @markdavidboyd

It’s is a little bit easier than that! The function can be used in any input field and only takes in one argument. That argument is the HTML that you want to strip. You can use the function in the ‘Message’ field of the Discord module, like this:

Cheers,
Henk

1 Like

Legend thank you so much! That makes sense! Super easy! oh my! I’ll look at it first thing tomorrow! (I’m in Australia and winding down for the night)

2 Likes

Great! I will be happy to hear the outcome!

If it worked, you can mark the reply as Solution, so that everyone knows this thread is solved.

Have a nice evening :slight_smile:

Cheers,
Henk

2 Likes

Welcome to the Make community!

No, usually this error occurs when the message exceeds the message character limit, and has nothing to do with HTML.

It just happens that the HTML string content is longer than the character limit too.

samliewrequest private consultation

Join the unofficial Make Discord server to chat with us!

2 Likes

Ahh yep, it didn’t work, but i think samliew might be right too. Both a problem with Discord and the message/character limit. Back to the drawing board for what i was trying to do :slight_smile:

Thanks @samliew , i suspect you are correct. I’ll need to think about a different way to achieve what i was trying to do. :slight_smile:

If it helps, there are two workarounds:

  1. Your server could be Nitro boosted to increase the character limit to 4000 characters

  2. You could split the message into multiple messages, by using the built-in substring function.

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

General

Help Center Basics

Articles & Videos

samliewrequest private consultation

Join the unofficial Make Discord server to chat with other makers!

1 Like

You can try wrapping the output into stripHTML(Body: Content). Or use text parser which is a bit more advanced to get exactly what you want from the input without without header or footer content.

Here:
https://www.make.com/en/help/functions/string-functions#striphtml--text-