Automatic New IMAP emails sent and Archive

Discuss RoboTask here
Post Reply
aa1508
Posts: 3
Joined: Thu Jul 25, 2019 7:43 pm

Automatic New IMAP emails sent and Archive

Post by aa1508 »

Hello, I've been using Robotask for the past 6 months and thus far it phenomenal.
Would you help with the following task?

We need to send "Faxes" through email automatically.
Our current software generates two different files per each fax. .PDF and .FMI (opens with notepad)
6F24C248-1C8E-42DA-89C1-EE2FC47B8741.pdf
6F24C248-1C8E-42DA-89C1-EE2FC47B8741.fmi

The .fmi file content looks like the following:
-----------------------
[Fax]
UniqueId=6F24C248-1C8E-42DA-89C1-EE2FC47B8741
FileType=PDF

[From]
UserID=4
UserCompany=Your Company
UserName=Your username

[To]
FaxCompany=
FaxName=
FaxNumber=8881234567
FaxComments=
DialAreaCode=N
UseAreaCodeRules=N

[ClientRecord]
RecordID=E080C776-1B45-4CBC-9F9C-F9AB5F73AD81
RecordType=Document
--------------

I need to do the following:
1. Robotask periodically reviewing a folder for new files.
2. Sending an email with the .pdf file as an attachment
3. Extract the FAXNUMBER only from the .fmi file
4. Send an email to {FAXNUMBER}@faxingcompany.com (where @faxingcompany.com is always a constant)
5. Archive the original files to a different folder

I hope you can help. Thank you
Oleg
Site Admin
Posts: 3004
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Automatic New IMAP emails sent and Archive

Post by Oleg »

Look at my example please
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1075658632
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task611"
Hide=INTEGER|0
ID=INTEGER|27282500
LogOnAsUser=INTEGER|1
Name=STRING|"FAX num"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action13=FOLDER
Action14=FOLDER
Action15=FOLDER
Action16=FOLDER
Action17=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""INFOLDER"" with value ""D:\incoming\pdf"""
Params=FOLDER

[Actions\Action1\Params]
=STRING|""
expand=STRING|"0"
varname=STRING|"INFOLDER"
varvalue=STRING|"D:\incoming\pdf"

[Actions\Action10]
ActionID=STRING|"A_FILE_COPY"
Enabled=INTEGER|-1
Name=STRING|"Copy/Move File"
Params=FOLDER

[Actions\Action10\Params]
destdir=STRING|"{ArcFolder}"
f_count=STRING|"2"
file0=STRING|"{file}"
file1=STRING|"{pdf}"
hidden=STRING|"1"
ifexists=STRING|"1"
move=STRING|"1"
rename=STRING|"0"
renamemask=STRING|"*.*.new"
subdir=STRING|"0"
system=STRING|"1"

[Actions\Action11]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"

[Actions\Action12]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Fax number not found"""
Params=FOLDER

[Actions\Action12\Params]
=STRING|""
icon=STRING|"3"
msg0=STRING|"Fax number not found"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action13]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action14]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"

[Actions\Action15]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""File {PDF} is not found"""
Params=FOLDER

[Actions\Action15\Params]
icon=STRING|"3"
msg0=STRING|"File {PDF} is not found"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action16]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"

[Actions\Action17]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""ARCFOLDER"" with value ""D:\incoming\pdf-arc"""
Params=FOLDER

[Actions\Action2\Params]
expand=STRING|"0"
varname=STRING|"ARCFOLDER"
varvalue=STRING|"D:\incoming\pdf-arc"

[Actions\Action3]
ActionID=STRING|"A_LOOP_FILE"
Enabled=INTEGER|-1
Name=STRING|"File Loop"
Params=FOLDER

[Actions\Action3\Params]
createmode=STRING|"1"
date1=STRING|"20190730"
date2=STRING|"20190730"
destvar=STRING|"FILE"
DuringDays=STRING|"1"
DuringHours=STRING|"1"
DuringMinutes=STRING|"1"
DuringMonths=STRING|"1"
file0=STRING|"{InFolder}\*.fmi"
filecount=STRING|"1"
OlderDays=STRING|"1"
OlderHours=STRING|"1"
OlderMinutes=STRING|"1"
OlderMonths=STRING|"1"
savesize=STRING|"0"
searchkind=STRING|"0"
sort=STRING|"0"
sortby=STRING|"0"
sortorder=STRING|"0"
subdirs=STRING|"0"
timesize=STRING|"0"
WithoutPath=STRING|"0"

[Actions\Action4]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""PDF"" with value ""{ExtractFilePath({file})}\{ExtractFileNameNoExt({File})}.pdf"""
Params=FOLDER

[Actions\Action4\Params]
expand=STRING|"1"
varname=STRING|"PDF"
varvalue=STRING|"{ExtractFilePath({file})}\{ExtractFileNameNoExt({File})}.pdf"

[Actions\Action5]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action5\Params]
case=STRING|"0"
connection=STRING|"0"
count=STRING|"1"
operator=STRING|"0"
type=STRING|"3"
value1=STRING|"{FileExists({PDF})}"

[Actions\Action6]
ActionID=STRING|"A_REGEXP_MATCH"
Enabled=INTEGER|-1
Name=STRING|"RegExp Match"
Params=FOLDER

[Actions\Action6\Params]
=STRING|""
anchored=STRING|"0"
case=STRING|"0"
extended=STRING|"0"
file=STRING|"{file}"
linecount=STRING|"0"
multiline=STRING|"0"
noautocapture=STRING|"0"
pattern=STRING|"(?im)^faxnumber=(\d+)$"
savesubexpression=STRING|"1"
singleline=STRING|"0"
subexpressionpos=STRING|"0"
subexpressionvar=STRING|"expr"
ungreedy=STRING|"0"
useexternal=STRING|"1"
variable=STRING|"found"

[Actions\Action7]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER

[Actions\Action7\Params]
=STRING|""
case=STRING|"0"
connection=STRING|"0"
count=STRING|"1"
operator=STRING|"0"
type=STRING|"3"
value1=STRING|"{found}"

[Actions\Action8]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""fmi file: {file}"""
Params=FOLDER

[Actions\Action8\Params]
=STRING|""
icon=STRING|"1"
msg0=STRING|"fmi file: {file}"
msg1=STRING|"PDF: {pdf}"
msg2=STRING|"FAX: {expr(1)}"
msgcount=STRING|"3"
playsound=STRING|"0"
showmessage=STRING|"1"

[Actions\Action9]
ActionID=STRING|"A_MISC_COMMENT"
Enabled=INTEGER|-1
Name=STRING|"//moving to archieve"
Params=FOLDER

[Actions\Action9\Params]
comment=STRING|"moving to archieve"
I think you are able to modify this example for your purposes
Oleg Yershov
Post Reply