Email Module Error

:bullseye: What is your goal?

Fix the error in the Email module

:thinking: What is the problem & what have you tried?

Hi! I have the following scenario: Webhook → Make AI Toolkit → Email (Send an Email).

The data.from field coming from the webhook contains the sender in the format “Name [email protected]” instead of just the clean email address. When I map it directly to the “To” field in the Email module, I get this error:

Couldn’t send the email in ActionSendEmail. The To field got an invalid email address from the webhook data.

Here’s what I’ve already tried:

•	regex(2.data.from; "pattern") → Error, it says the regex function does not exist in Make
•	get(match(2.data.from; "pattern"); 1) → Still not working / the text editor overwrites what I type with browser autocomplete
•	Mapping 2.data.to[1].value as suggested by the automatic error analyzer → Also didn’t resolve the issue

Does anyone know the correct syntax in Make to extract only the email from a string like “Name [email protected]”? Or is there a more direct way to clean this data before passing it to the Email module?

Thanks!

:clipboard: Error messages or input/output bundles

Error
Couldn’t send the email from this module. The To field got an invalid email address.

Possible fixes:

Use a valid email in the To field.
Trim extra text from the To mapping.
Add ifempty() for empty sender values.

:link: Create public scenario page

:camera_with_flash: Screenshots (scenario flow, module settings, errors)

Use replace(), not regex() or match(). In the Email module’s To field, map data.from as the first argument in this expression:

replace(2.data.from; /.?([A-Z0-9._%±]+@[A-Z0-9.-]+.[A-Z]{2,})./i; $1)

For a value such as "Name [email protected] ", the capture group is the address and $1 makes replace() return only [email protected]. Insert replace from the Text and binary functions tab so data.from remains a mapped token. If the field editor keeps changing what you type, double-click the mapped value to edit the formula as plain text, then click outside the field when finished.

Make documents both regex search patterns and $1 capture-group replacements under replace(): Text and binary functions - Help Center

Plain-text editing for mapped formulas is documented here: Improved error handling and plain-text editing for mapped values - Help Center

Hey there,

can you use the code formatting option so the formula is directly copy/pasteable? Cause now its not.

Your split() approach was also solid, but you botched the formula a bit:

{{get(split(first(split(2.data.from; ">")); "<"); 2)}}

This will take anything between < and >