|
ScanInbox - Functions
AddToTotal(Condition, Currency, Amount)
AddToCount(Condition, Currency, Count)
AddToTextFile(Condition, Textfilename, Fieldnames)
LoadTextField(Condition, Textfilename, Fieldname)
LoadIndexedTextField(Condition, Textfilename, "indexField=Targetfield")
RunApplication(Condition, ExePath, CommandLine)
Reply(Condition, Templatefilename, "from:subject")
SaveEmailToTextFile(Condition, TextFileName)
AddToTotal(Condition, Currency, Amount)
This function adds the specified amount to the total amount for the given currency.
The total counters and amounts for EUR and USD are shown on the main window.
AddToCount(Condition, Currency, Count)
This function adds the specified count to the total count for the given currency.
The total counters and amounts for EUR and USD are shown on the main window.
AddToTextFile(Condition, Textfilename, Fieldnames)
This function adds the values of the specified fields to the specified text file.
For example:
AddToTextFile("", "customers.txt", "%NAME%;%EMAIL%")
Will find the values of the NAME and EMAIL field in the datasource
(typically the original email), and add those to customers.txt.
LoadTextField(Condition, Textfilename, Fieldname)
This function loads the content of the specified file into the specified fieldname.
After this function has run, you can use the fieldname in your templates to refer to
the content read from the file.
Tip: This is handy if you use external tools to generate values. Run the application
with field-specific command line parameters to generate some unique value for the data
found in the email, then load the generated value into a text field for use in the reply.
LoadIndexedTextField(Condition, Textfilename, "indexField=Targetfield")
This function looks up a value in a textfile and loads it into a target field.
After this function has run, you can use the fieldname in your templates to refer to
the value that was looked up.
The textfile must consist of data in the following format:
LookupValue=ResultValue
For example, consider the following textfile (test.txt):
1=Option1 was selected.
2=Option2 was selected.
If you use the function LoadIndexedTextField("", "test.txt", "%MYLOOKUP%=%MYVALUE%")
and the value of the MYLOOKUP field is 2, the MYVALUE field becomes "Option2 was selected".
RunApplication(Condition, ExePath, CommandLine)
This function starts an external application or script. Both the commandline and the name
and path of the executable is checked for field values and replaced accordingly.
For example, consider the following action:
RunApplication("", "c:\myfolder\myapp.exe", "email=%EMAIL%")
If the EMAIL field has a value of "no@no.com" when this action is rendered, the command line
that is executed will look like this:
c:\myfolder\myapp.exe user=no@no.com
Reply(Condition, Templatefilename, "from:subject")
This function performs a Reply on an email. The email template specified in TemplateFilename
is loaded, and any fields in either the email template or the subject line are replaced with
the value of the field.
The From:Subject parameter specifies the From address to use, and the subject line.
For example, consider the following action:
Reply("", "mytemplate.txt", "Me@Me.com:Hello %USER%")
Where mytemplate.txt is:
Hi %USER%,
We have registered an incoming email from you (%EMAIL%),
and will contact you shortly for further information.
If we assume the datasource (i.e. the original email) contains:
USER=Virtual User
EMAIL=No@No.com
The action will result in the following email when run:
From: Me@Me.com
Subject: "Hello Virtual User"
Hi Virtual User,
We have registered an incoming email from you (No@No.com),
and will contact you shortly for further information.
SaveEmailToTextFile(Condition, TextFileName)
This function saves the content of the email to the given textfile. The textfilename can
include field names, these are then replaced with the value of the field.
|