In addition to the standard Trigger conditions you can create 'Trigger Condition Scripts'. Trigger Condition Scripts allow you to have complete control of the execution of a Trigger for a specific message. The script is executed by the Edge Server as each message is received for the current account.
For example, you may only want ThinkAutomation to process a message based on very specific criteria that cannot be handled by the standard Trigger Conditions entries.
Check the Condition Script option on the Trigger settings and click the Edit button to open the ThinkAutomation Basic script editor.
To cause the Trigger to be processed by ThinkAutomation you must set the variable 'ThinkAutomationTrigger' to True in the Sub Main procedure. Before ThinkAutomation fires the trigger condition script it will check the standard trigger conditions first and pre-set the ThinkAutomationTrigger property.
You can then write your basic script directly in the code window or open an existing saved script. The script can be as big as you need and contain any number of Sub-procedures and Functions. You can also use the Add Reference button to create links to external COM objects.
Within the script you can access properties about the current message via the ThinkAutomationMessage object. Click the Object Browser button to view a list of available properties. For example, the property ThinkAutomationMessage.Body returns the message body. ThinkAutomationMessage.HeaderValue("header") will return a header value.
In the above example we are checking the number of attachments for the current email message. Only if the email contains an attachment called 'order.pdf' will the ThinkAutomationTrigger flag be set to True (and therefore the Trigger will be fired).
Within the code editor you can access on-line help for all basic functions. Help is context sensitive. Move your cursor to the beginning of the keyword and press F1.