How to create an email inbound action to support French Language?

Karuppasamy
Tera Contributor

It should create a ticket whenever the body of the French email contains Forward(FW) as TRansfert(TR) and From as De

2 REPLIES 2

msd93
Kilo Sage

Hi @Karuppasamy 

 

Please try the below inbound action

 

(function run() {
var email = current.email;
var emailBody = email.body_text;

// Check if the email body contains "Forward" or "Transfert" and "From" or "De"
if ((emailBody.indexOf("Forward") !== -1 || emailBody.indexOf("Transfert") !== -1) && (emailBody.indexOf("From") !== -1 || emailBody.indexOf("de") !== -1)) {
// Create an incident
var gr = new GlideRecord('incident');
gr.initialize();
gr.short_description = 'French Email Incident';
gr.description = 'Incident created from a French email with "Forward" or "Transfert" and "From De".\n\nEmail Body:\n' + emailBody;
gr.insert();
}
})();

 

Please mark the asnwer helpful, if this solution works for you.

Actually while forwarding the mail, FW: is added to the headline of the email. so while forwarding the mail, we should get TR: as the prefix for the French mail. Is there any solution for this?