Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
subtletrue
colourYellow
titlesince 2.7.0

Table of Contents


Introduction

The Script Field Processor allows the outcome of a message's processing to be decided preemptively.

This can be useful when you want messages to fail for reasons that they would not normally.

Methods

There are currently four outcomes which can be decided via a script:

  • Dropped

    Code Block
    languagejs
    jemhUtils.dropMessage(String reason)

  • Filtered

    Code Block
    languagejs
    jemhUtils.filterMessage(String reason)

  • Forwarded

    Code Block
    languagejs
    jemhUtils.forwardMessage(String reason)

  • Rejected

    Code Block
    languagejs
    jemhUtils.rejectMessage(String reason)

  • Dropped (Drop and exit group)

    Code Block
    languagejs
    jemhUtils.dropAndExitGroupMessage(String reason)

Outcome results

Message Outcome

Sender Notified?

Admin Notified?

Read/Deleted?

Dropped

No

No

Yes

Filtered

No

No

No

Forwarded

No

Yes

Yes

Rejected

Yes

No

Yes

Dropped (Drop and exit group)

No

No

Yes


Info

If HintOgrams are turned off, rejections will be treated as being forwarded.

Image RemovedImage Added

Example Script

This could be used to reject a message if it contains a certain word within the subject:

Code Block
languagejs
if (subject.contains("reject")) {
    jemhUtils.rejectMessage("Because I don't like the word reject!");
}

The above example produces the following results within the Processing Detail Report:

Info

Enable Auditing by clicking Enable on the Auditing page to see these when running Test Cases and for previously processed mail

Image RemovedImage Added

Email (HTML) received by the sender:

To customise the contents of these emails, please /wiki/spaces/JEMH/pages/2850840.

Further information

The documentation for each of the jemhUtils methods can be found here:
http://ppl-docs.s3-website-us-east-1.amazonaws.com/JEMH/2.2.3/com/javahollic/jira/emh/api/IJEMHVelocityContextUtils.html