Extract email as plain text

Good day.

I have a scenario running that collects data from my Google calendar and creates a customer in QuickBooks. I am getting errors stating: ValidationFault: Invalid Email Address format (Email Address does not conform to the syntax rules of RFC 822. Supplied value:<span><span><a href="mailto:xxx@westnet.com.au" target="_blank">xxx@westnet.com.au</a></span></span>)
I assume this is happening because the email is presented as a link instead of plain text. I can’t find a way in Google calendar to keep the email address in plain text – it automatically converts it to a "mailto href. How can I strip the email address into plain text in Make to overcome this problem?

The email address info is currently provided in my Calendar description. I’m using the multiple variable tool in Make to obtain the data from the calendar entry.

Thanks

Welcome to the Make community!

To do this, you can try using the Text parser “Match elements” module —

Searches string elements matching predefined patterns.

One of the patterns include “Email”.

For more information about the Match elements module and Text parser app, see the corresponding Integrations page and the Help Centre documentation.

Alternatively, you can use the built-in function:

  • replace
    replace(text; search string; replacement string)

Here’s an example of how you can use this function:

{{ replace(1.text; "/^[\w\W]*?([\w.+_-]+@[\w.+_-]+)[\w\W]*$/"; "$1") }}

Proof https://regex101.com/r/7OAt69/1

Hope this helps! If you are still having trouble, please provide more details.

@samliew

1 Like

Thank you very much. That works perfectly.