The post script section of the Email Manager is used to execute custom SQL against your HelpMaster database once the current profile actions have been performed. This is the last action to occur once an email has been successfully picked up and processed by the Email Manager. The post script features gives you the ability to extend and update HelpMaster database information and develop custom solutions that your operations may require.
Use the post-script feature to…
- Update a job with custom values
- Link assets, clients, site, and knowledge base to newly created jobs
- Create custom reporting tables
- Call a custom database stored procedure
Using variables in a script
The post script is similar to the Parser script, in that you can use any of the parser values as part of the SQL script. The post script window gives access to the following variables that can be used within your script. These place-holders can be used in your script and will be replaced with the actual value of the variables at run-time.
JobPKID: This is an integer value that corresponds to the unique number of the job that was just created by this profile. Only applies if a profile is a “Create job” style profile.
ActionPKID: This is an integer value that corresponds to the unique number of the action/update that was just created by this profile. Only applies if a profile is a “Update job” style profile.
ClientPKID: This is an integer value that corresponds to the unique number of the existing client that was just linked to the job or action created by this profile.
SitePKID: This is an integer value that corresponds to the unique number of the site that the existing client belongs to, and was just linked to the job or action created by this profile.
NewClientCreatedPKID: This is an integer value that corresponds to the unique number of the client that was just created by this profile. Only applies if the profile created a new client as part of creating new job, or updating an existing job via an action. This is based on the client creation options defined in the profile. See New Client options
In addition to the preceding variables, any other variables that you have defined as part of the parsing logic will display in the list.
Double-click on a variable to insert it into the script text at the position of the cursor, or use the auto-text feature by starting to type the name of the variable. Type “<<” to display a list of all of the available variables. Press Enter to insert a variable.
Use the post script feature with caution!Always test against a copy of your live database. Remember that there is no “undo” with direct database SQL. Use a narrowing “Where” clause, or similar device to limit the scope of your SQL script to only the database objects/records that you require.
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.