@Kelly, Mike@DWR Thanks for reaching out. As per the response from team trigger the body will contain the JSON object as below. So you need to do a match on the content (string content) and not the JSON body object. You need to add the .content
at the end of your 2nd statement in javascript as below. You can always check the output of the trigger from the run history to know what is output JSON object the trigger is returning.
"body": {
"contentType": "text",
"content": "<<your actual text content>>"
}
var reg = /([a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+.[a-zA-Z0-9_-]+)/g;
var email = workflowContext.trigger.outputs.body.body.content;
return email.match(reg);
Feel free to get back to me if you need any assistance.