The Zurich release has arrived! Interested in new features and functionalities? Click here for more

How do I access "origemail" in Inbound email action flow?

Shahid4
Tera Contributor

I am trying to use Inbound email flow instead of Inbound email actions. To be honest I am really struggling with finding right information.

 

I need to use email.origemail in my flow but can't find it. For example, I tried: 

fd_data.trigger.inbound_email.origemail

 but no luck. I also tried to look into the headers, again no luck from the flow.

 

Any idea? Thanks

5 REPLIES 5

Shruti
Mega Sage
Mega Sage

Hi @Shahid4 

Use the below script to fetch original email from email body

var emailBody = fd_data.trigger.body_text;
var regex = /From:\s(.*)/; // Example regex to find the "From:" header
var match = emailBody.match(regex);
 
if (match && match[1]) {
    var originalSender = match[1].trim();
    var finalAddress = originalSender.match(/<([^>]+)>/);
     return finalAddress[1];
}