Mailbox event, execute after message is saved

This is a CRMScript you can add under the menu System design in the screen System Script.

Here you can add CRMScript code that will be executed for all mailboxes after the mail has been processed by any email filters (except scripts to be executed for the filter) and saved to the system. The script will be executed before any notifications and email-filter scripts are run. The call sequence can be described like this:

  1. Get emails from the mail server
  2. Analyze email
  3. Run the “Mailbox event, executed before message is saved” script
  4. Run mailbox filter code (except attached script)
  5. Store message to the system
  6. Run this script
  7. Run mailbox filter attached scripts
  8. Send notifications

There are several variables available in this context. These can be obtained by

getVariable("xxx")

Read-only variables

VariableDescription
messageIdThe ID of the newly created message
ticketIdThe ID of the ticket
customerIdThe ID of the primary customer connected to this ticket
customerEmailEmail address of the primary customer connected to this ticket
mailBackupRaw version of the email
isNewCustomerset to 1 if this email created a new customer/person (from version 8.1 - R13)

In addition, any variables set by the email filter are also available with the name specified in the email filter.