Inbound email replys

Nataliia_Lova
Tera Guru
Hello, Community,
I'm working on inbound actions. Where users reply to the notification, this response has to update the record in the "Additional comments" field. What should I type into the Script?
Screenshot 2024-01-12 at 16.46.16.png
1 ACCEPTED SOLUTION

Aniket Chavan
Tera Sage
Tera Sage

Hello @Nataliia_Lova ,

You can try with the script below and let me know how it works for you.

(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
    if (current.getTableName() == "x_1111599_finance_request" && email.subject.indexOf("request Fin") !== -1) {
        current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
        current.update();
    }
})(current, event, email, logger, classifier);

 

Let me know your views on this and Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks,

Aniket

View solution in original post

7 REPLIES 7

My Script should looks like this: 
(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
current.update();
})(current, event, email, logger, classifier);
 
 or like this: 

gs.include('validators');

 

if (current.getTableName() == "x_1111599_finance_request") {

   current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;

   current.update();

}

Aniket Chavan
Tera Sage
Tera Sage

Hello @Nataliia_Lova ,

You can try with the script below and let me know how it works for you.

(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
    if (current.getTableName() == "x_1111599_finance_request" && email.subject.indexOf("request Fin") !== -1) {
        current.comments = "reply from: " + email.origemail + "\n\n" + email.body_text;
        current.update();
    }
})(current, event, email, logger, classifier);

 

Let me know your views on this and Mark Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.

 

Thanks,

Aniket

Hi.       x_1111599_finance_request

What are you typing in the green letters here?

Thank you.