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

6 REPLIES 6

Shruti
Giga Sage
Giga 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];
}

 

 

@Shruti  

i want to fetch whole email body received on replies from user through  inbound