How to fix: Invalid email address in parameter 'to'

Hello,
Developed a scenario that extracts the email address and message body from customer-submitted forms on our website, the content is analyzed by ChatGTP and Gmail is used to send the email.

We use the “result” from the email address extraction as the recipient. It seems to work for a few cycles until it returns the error :

  • Validation failed for 1 parameter(s).
  • Invalid email address in parameter 'to'."


If the email address comes from ChatGPT then the problem could be with the prompt. Check the execution history of your scenario and look at the ones that failed. See what ChatGPT gave as output. That might help you figure out where the problem is.

L

Thanks

Th email output is pretty inconsistent, even though the form in which customers provide their email address is the same.

Is there a better way to fetch emails when customers sign up via website forms?

Normally the form should give you a way to get the data.

What are you using? Google Forms? If so, you can tell it to save the data in a Google Sheet and take the data from there. The other option is to have Google Forms send the data to make directly. I did it here:

Maybe that can help.

L

We’re using Squarespace but perhaps I can fetch the data from the form using a webhook instead?

If Squarespace allows you to send the data directly to a webhook, yes you can do that.

If you’re getting the data by email and squarespace sreates a structured email, you should be able to extract the information using a text parser or regular expressions. Give ChatGPT the content of the email and ask you to create a regular expression that parses it for you.

If ChatGPT is having problems fetching the email, then your prompt needs to be fixed, or the Squarespace form needs to be fixed to make sure it only accepts valid email addresses.

Finally, if that doesn’t work, you can put a filter before the GMail module and if the email is empty. don’t call it.

L

Hey,
This is what the text parser and text content dialogue looks like at the moment. I had an intern setting this up a while ago so I’m not sure if this is actually the correct way of doing it?


Did you check the execution history of your scenario?

I don’t know what your getting as input si I can’t tell you if the text parser is doing what is supposed to do.

The text parser finds text between two square brackets. If your incoming text doesn’t contain that information, the scenario stops.

L

Squarespace forms can be sent to a webhook, so there’s no need to use chatgpt at all to get that extracted.

It comes as structured data so you can easily map it