The Field Portal Alerts Service is a sub-system within Technisoft Service Manager they can be enabled to generate emails to notify employees of appointments that have been created within the system.
The steps required to enable alert notifications are to:
•Ensure that each employee has a valid email entered within the system
•Edit the alerts configuration file to configure credentials and SMTP settings
•Edit the email template to contain the text you wish the alerts email to contain
•Activate the system within Company Options
•Schedule the alerts service program to execute at the desired time interval
All files relevant for Alerts are installed in the Alerts subfolder of the installation folder.
For each active employee enter a valid email address. This can be entered in the Contact group of the Profile tab of the Employee Setup screen.
The config file is the Alert.exe.config file located in the Alerts sub-folder of the Field Portal installation folder. Update the highlighted fields as shown below with the relevant information for your installation.
The domain and log file options are optional, but the latter is useful when trying to get the system up and running for the first time. The domain is used for Windows Authentication to Sage 300, and the log file can be used to save all log entries that normally shows on screen to a text file.
See Microsoft documentation for detailed information about how to configure .net emailing.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="username" value="ADMIN"/>
<add key="password" value="ADMIN"/>
<add key="company" value="SI62A"/>
<add key="domain" value="domain"/>
<add key="logfile" value="log.txt"/>
</appSettings>
<system.net>
<mailSettings>
<smtp deliveryMethod="Network" from="no-reply@companyx.com">
<network
host="smtp.companyx.com"
port="25" />
</smtp>
</mailSettings>
</system.net>
</configuration>
The email template – dispatch.txt - can also be found within the Alerts sub-folder of the Field Portal installation folder. While any and all text can be modified at will, the first line should read as shown below as the alerts program looks for this line to generate the email subject line. You can of course change the text after the colon to whatever you like.
The highlighted text can be modified to:
•Set the email subject
•Inject a field from VMREST or VMEMPL views
•Set the URL to server
subject:Field Portal - Dispatch
A new appointment has been dispatched to you.
Please confirm your availability in Field Portal.
Time Entry ID: @NMUNIQ
Job: @TXDOCID
Site: @TXSITE
http://serverURL/fieldPortal20/Search/Result?name=dispatched&returnUrl=%2FfieldPortal
The URL provides employees with a hyperlink that can be selected to open Field Portal at the Dispatch page.
To activate the alerts system you must turn on the dispatch logging mechanisms from the Company Options screen. Tick the Use Time Entry Dispatch Management option on the Time tab, and then selected the desired Default Dispatch state. Emails will only be generated if the dispatch setting is Dispatched to Assignee.
By running the alerts.exe file an email will be generated for each appointment (a.k.a. estimate or time entry).
Technically, an email is generated for each row within the VMREST table that has WDDISPATCH = 20 (Dispatch to Assignee) and WDDISPSENT = 0 (Not Sent), but only if the employee has a valid email address and the SMTP server settings are configured correctly.
Note that in a multi-server environment it might be necessary to run the Alert.exe program in the context of a domain user.
Before running alerts for first time it is a good idea to reset old alerts that might be in the system to avoid that old non-relevant dispatch emails are not sent out. This is done by running the following command from a command prompt in the Alerts subfolder.
Alert -r
To manually test the setup run alerts from the command line with no arguments.
Alert
The console window will show a log of what is sent out. If there is an error when processing alerts it will return with error level 1.
In some scenarios is might be needed to start alerts with different options that what is set in alert.exe.config. One example is when sending alerts for more than one Company. In that case first run Alert without any arguments, then with optional argument to override Company to set it to the 2nd Company name as shown below.
Alert
Alert -c COMP2
In this case it might be useful to combine the alert actions into one BAT file.
The following options are available:
-u Username Alert -u TEST -p Password
-p Password Alert -u TEST -p Password
-c Company Alert -c COMP2
-r Reset Alert -r
-d Domain Alert -u TEST -p Password -d Domain
-l Log file Alert -l log.txt
One option to run alerts unattended is to use Windows Scheduler.
The included Scheduler definition Field Portal - Alerts.xml file can be used as a template but after importing it you have to check its settings and save it under the current user.