- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2024 07:25 AM
I want to trigger an email action based on the value of the "from" email. It would not be an email from the sys_user table as the field provided for that seems to be based on. So I'm trying to do so via the action script.
(function runAction(/*GlideRecord*/ current, /*GlideRecord*/ event, /*EmailWrapper*/ email, /*ScopedEmailLogger*/ logger, /*EmailClassifier*/ classifier) {
if(email.origemail == "sentFromEmailString") {
current.opened_for = gs.getUserID();
current.comments = "received from: " + email.origemail + "\n\n" + email.body_text;
current.short_description = email.subject;
current.type = "email";
current.insert();
} else {
return false;
}
})(current, event, email, logger, classifier);
It is not currently working that way. What would be the best way to achieve this?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2024 07:32 AM
Hi Gabriel,
Try replacing
if(email.origemail == "sentFromEmailString") {
with
if(email.from.indexOf('sentFromEmailString')>-1) {

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-23-2024 07:32 AM
Hi Gabriel,
Try replacing
if(email.origemail == "sentFromEmailString") {
with
if(email.from.indexOf('sentFromEmailString')>-1) {
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-24-2024 06:33 AM
This works thank you!