...
API | Notes | ||||
---|---|---|---|---|---|
| Get body content of email. Not available for preprocessing task. | ||||
| Gets the Subject content of email. | ||||
| Get all headers of a message.
To loop through all headers:
| ||||
| Get value of a message header Parameters
| ||||
| Set the value of a message header Parameters
| ||||
| Adds output that is recorded during execution and shown in the processing report. Parameters
| ||||
| Set the processing outcome of the script Parameters
Note: | ||||
| Field processor and Script Rule only. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map Note: | ||||
| Searches within string values for matching content.https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp | ||||
| This is used to define that the script rule is a match. This will result in that Rule and Project being used to process the email. |
Examples
Getting all recipients
Code Block |
---|
var combined;
if (message.getHeader('to')!==null) {
combined = message.getHeader('to');
}
if (message.getHeader('cc')!==null) {
if (combined!==null) {
combined=combined.concat(message.getHeader('cc'));
} else {
combined=message.getHeader('cc');
}
}
if (message.getHeader('bcc')!==null) {
if (combined!==null) {
combined=combined.concat(message.getHeader('bcc'));
} else {
combined=message.getHeader('bcc');
}
}
combined=combined.toLowerCase();
print("Recipients: "+combined); |
Match a keyword in the email body using a regular expression
...