- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 10:24 AM - edited 06-25-2024 11:28 AM
What's the best method for retrieving the original recipient list from a forwarded email.
Scenario:
1. Original email with multiple recipients in "To" and "Cc" is forwarded to SN. The result, only the SN email address is stored in email.to
2. The original sender of the forwarded email is captured in email.body.from
3. Requirement is to capture the original recipient list before the email was forwarded and store email values to be used later.
Example: Email was sent by Jessica with Heather, Adele in "To" and Wendy, Rebecca in "Cc." Next, the email was forwarded to SN. Using an Inbound Action, the forwarded email creates a record.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 11:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2024 07:00 AM - edited 10-14-2024 07:03 AM
var opened_for = '';
var str = email.body.from;
var mySubString = str.substring( //mySubString equals the email address
str.lastIndexOf("<") + 1,
str.lastIndexOf(">")
);
var user = new GlideRecord('sys_user');
user.addQuery('email', mySubString);
user.query();
if (user.next()) {
opened_for = mySubString;
} else { //Can't match on email address
opened_for = sys_id of your choice
current.field_name = mySubString; //This line is necessary if you are tracking the email address on the form
}
current.opened_for = opened_for;