start_agent_info
AgentName = "AU_MAIL_CAMPAIN_FSM_AGENT"
AgentDescr = "Mail Campain"
AgentLanguage = ""
__timer_interval = 0 {....define
(in seconds
) the timer interval
for the wake up}
__delete_on_termination = 0 {....1=the agent frees itself
when terminates its task}
end_agent_info
start_bpm_activity "Mail S
ended"
start_bpm_validation
{.....put here a calculation that returns
(1
)}
{.....as result
when the event was happened!}
result = 1
end_bpm_validation
end_bpm_activity
start_bpm_activity "Wait
for Mail"
start_bpm_validation
rec_id = __params[1]
rec_itm_id = __params[2]
col_id = __params[3]
cmail = __params[4]
result = mail_checkdatacollector
( col_id
, cmail
)
if (result = 1
) then
ag = agent_askexpert
("AU_MAIL_CAMPAIN_FSM_AGENT"
,"INSPECT_INBOUND_MAIL"
,rec_id
,rec_itm_id
,col_id
)
endif
end_bpm_validation
end_bpm_activity
start_bpm_activity "New Mail Campain"
start_bpm_subactivity "Campain"
rec = __params[1]
expr = strcat
(rec
,"=AU_MAILCAMP"
)
call OpenFormTop
("ptEdit"
,"
AU_MAILCAMP_E.FM"
,"WORK.AU_MAILCAMP"
,1
,expr
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Mail Arrived"
start_bpm_subactivity "Campain"
rec_itm_id = __params[2]
expr = strcat
(rec_itm_id
,"=AU_MAILCAMP_ITM"
)
call OpenFormTop
("ptEdit"
,"
AU_MAILCAMP_ITM_E.FM"
,"WORK.AU_MAILCAMP_ITM"
,1
,expr
)
end_bpm_subactivity
start_bpm_subactivity "Inbound Mail"
end_bpm_subactivity
start_bpm_subactivity "Colected Data"
col_id = __params[3]
call OpenFormTop
("ptBrowse"
,"
AU_DATACOLLECT_B.FM"
,"QRY.DATA"
,"INSPECT_MODE"
,col_id
)
end_bpm_subactivity
end_bpm_activity
start_bpm_activity "Res
end Mail"
start_bpm_subactivity "Campain"
rec_id = __params[1]
expr = strcat
(rec_id
,"=AU_MAILCAMP"
)
call OpenFormTop
("ptEdit"
,"
AU_MAILCAMP_E1.FM"
,"WORK.AU_MAILCAMP"
,1
,expr
)
end_bpm_subactivity
start_bpm_subactivity "Contact"
rec_id = __params[1]
con_id = LookUpId
("AU_MAILCAMP"
,rec_id
,"AU_CONTACT"
)
expr = strcat
(con_id
,"=AU_CONTACT"
)
call OpenFormTop
("ptEdit"
,"
AU_CONTACT_E.FM"
,"WORK.AU_CONTACT"
,1
,expr
)
end_bpm_subactivity
start_bpm_subactivity "Business Partnenr"
rec_id = __params[1]
bus_id = LookUpId
("AU_MAILCAMP"
,rec_id
,"AU_BUSINESS"
)
expr = strcat
(bus_id
,"=AU_BUSINESS"
)
call OpenFormTop
("ptEdit"
,"
AU_BUSINESS_E.FM"
,"WORK.AU_BUSINESS"
,1
,expr
)
end_bpm_subactivity
start_bpm_subactivity "New S
end"
rec_id = __params[1]
rec_itm_id = __params[2]
col_id = __params[3]
expr = strcat
(rec_itm_id
,"=AU_MAILCAMP_ITM"
)
call OpenFormTop
("ptEdit"
,"
AU_MAILCAMP_ITM_E.FM"
,"WORK.AU_MAILCAMP_ITM"
,1
,expr
)
end_bpm_subactivity
start_bpm_subactivity "Inbound Mail"
end_bpm_subactivity
start_bpm_subactivity "Colected Data"
col_id = __params[3]
call OpenFormTop
("ptBrowse"
,"
AU_DATACOLLECT_B.FM"
,"QRY.DATA"
,"INSPECT_MODE"
,col_id
)
end_bpm_subactivity
start_bpm_validation
result = 1
flag = agent_askexpert
("AU_MAIL_CAMPAIN_FSM_AGENT"
, "SEND_MAIL_AND_WAIT"
, __params[1]
, __params[2]
)
end_bpm_validation
end_bpm_activity
start_action
mode = __params[1]
rec_id = __params[2]
rec_itm_id = __params[3]
res
end_flag = __params[4]
start_sql "*" "KOSMOS"
SELECT AU_POS.POS_D
, AU_USER.UNAME
, AU_MAILCAMP.*
FROM (AU_MAILCAMP
LEFT JOIN AU_POS
ON AU_MAILCAMP.AU_POS = AU_POS.AU_POS
)
LEFT JOIN AU_USER
ON AU_MAILCAMP.AU_USER = AU_USER.AU_USER
WHERE (AU_MAILCAMP = :MC
)
end_sql
q = QueryByName
()
call TSetParam
(q
,"MC"
,rec_id
)
call TExecute
(q
)
business_id = TGetFld
(q
,"AU_BUSINESS"
)
contact_id = TGetFld
(q
,"AU_CONTACT"
)
__au_process = TGetFld
(q
,"AU_PROCESS"
)
comm = TGetFld
(q
,"SUBJECT"
)
subj = TGetFld
(q
,"MSUBJECT"
)
cmail = TGetFld
(q
,"CMAIL"
)
smail = TGetFld
(q
,"SMAIL"
)
draft = TGetFld
(q
,"DRAFT_FLAG"
)
sched = TGetFld
(q
,"SCHED_FLAG"
)
date = TGetFld
(q
,"SDATE"
)
ctype = TGetFld
(q
,"COLL_TYPE"
)
uname = TGetFld
(q
,"UNAME"
)
rname = TGetFld
(q
,"POS_D"
)
html_file = TGetFld
(q
,"HTML_FILE"
)
lang_id = LookUpId
("AU_CONTACT"
,contact_id
,"AU_LANGUAGE"
)
lang_c = LookUpId
("AU_LANGUAGE"
,lang_id
,"AU_LANGUAGE_C"
)
call FreeEmbSQL
(q
)
if (mode = "SEND_MAIL_AND_WAIT"
) then
__au_process = val
(__au_process
)
if (__au_process = 0
) then
__au_process = bpm_createprocess
("AU_MAIL_CAMPAIN_FSM_AGENT"
,""
,uname
,1
) {expert_activ_flag = 1}
parent_step = GetThrVal
("__parent_step"
)
call UpdateField
("AU_PROCESS"
,__au_process
,"COMM"
,comm
,"USER_OWNER"
,user
,"AU_STEP_PARENT"
,parent_step
,""
)
call UpdateField
("AU_MAILCAMP"
,rec_id
,"AU_PROCESS"
,__au_process
,""
) {...and maintains it in the record}
call bpm_setstepcomment
(comm
)
call bpm_onapp
end("AU_MAILCAMP"
,rec_id
) {...the record app
ending declares that the
next activity will be closed}
call bpm_setprocess
(__au_process
)
call bpm_setprocessbusiness
(business_id
)
call bpm_assign_job
( "New Mail Campain"
, uname
, rname
, 0
, rec_id
) {...so this activity never shows
to user }
start_sql "*" "KOSMOS"
INSERT INTO AU_MAILCAMP_ITM
end_sql
q = QueryByName
()
call TSetFld
(q
,"AU_MAILCAMP"
,"String"
,rec_id
)
call TSetFld
(q
,"CMAIL"
,"String"
,cmail
)
call TSetFld
(q
,"MSUBJECT"
,"String"
,subj
)
call TSetFld
(q
,"COLL_TYPE"
,"String"
,ctype
)
call TSetFld
(q
,"HTML_FILE"
,"String"
,html_file
)
call TSetFld
(q
,"DRAFT_FLAG"
,"String"
,draft
)
call TSetFld
(q
,"SCHED_FLAG"
,"String"
,sched
)
call TSetFld
(q
,"SDATE"
,"Date"
,date
)
call TSetFld
(q
,"AU_CONTACT"
,"Float"
,contact_id
)
call TExecute
(q
)
call FreeEmbSQL
(q
)
rec_itm_id = SelectLastId
("AU_MAILCAMP_ITM"
)
endif
start_sql "*" "KOSMOS"
SELECT *
FROM AU_MAILCAMP_ITM
WHERE (AU_MAILCAMP_ITM = :ITM
)
end_sql
q = QueryByName
()
call TSetParam
(q
,"ITM"
,rec_itm_id
)
call TExecute
(q
)
subj = TGetFld
(q
,"MSUBJECT"
)
cmail = TGetFld
(q
,"CMAIL"
)
draft = TGetFld
(q
,"DRAFT_FLAG"
)
sched = TGetFld
(q
,"SCHED_FLAG"
)
date = TGetFld
(q
,"SDATE"
)
ctype = TGetFld
(q
,"COLL_TYPE"
)
call FreeEmbSQL
(q
)
{..
(2
).......................................check type of data collector
to embbed in the html mail}
col_id = ""
if (ctype = "NONE"
) then
str = SelectFrom
("
SELECT DISP_NAME
, CPOSITION
, MAIL
, OFFICE_TEL
FROM AU_CONTACT
WHERE (AU_CONTACT="
,contact_id
,"
)"
)
name = GetSQLSelectItem
(str
,1
)
role = GetSQLSelectItem
(str
,2
)
cmail1 = GetSQLSelectItem
(str
,3
)
phone = GetSQLSelectItem
(str
,4
)
col_id = dcol_start
(comm
)
call dcol_set
(col_id
,"MAIL_SUBJECT"
,subj
)
call dcol_set
(col_id
,"AU_PROCESS"
,__au_process
)
call dcol_set
(col_id
,"AU_LANGUAGE"
,lang_id
)
call dcol_set
(col_id
,"AU_BUSINESS"
,business_id
)
call dcol_set
(col_id
,"AU_CONTACT"
,contact_id
)
call dcol_set
(col_id
,"CONTACT_MAIL"
,cmail
)
call dcol_set
(col_id
,"SUP_MAIL"
,smail
)
call dcol_set
(col_id
, "OPN_COMMAND"
, "
call OpenFormTop('ptEdit','AU_CONTACT_E.FM','WORK.AU_CONTACT',1,'"
,contact_id
,"=AU_CONTACT'
)"
)
call dcol_
end(col_id
)
endif
if (ctype = "CONTACT_FIELDS"
) then
str = SelectFrom
("
SELECT DISP_NAME
, CPOSITION
, MAIL
, OFFICE_TEL
FROM AU_CONTACT
WHERE (AU_CONTACT="
,contact_id
,"
)"
)
name = GetSQLSelectItem
(str
,1
)
role = GetSQLSelectItem
(str
,2
)
cmail1 = GetSQLSelectItem
(str
,3
)
phone = GetSQLSelectItem
(str
,4
)
col_id = dcol_start
(comm
)
call dcol_set
(col_id
,"MAIL_SUBJECT"
,subj
)
call dcol_set
(col_id
,"AU_PROCESS"
,__au_process
)
call dcol_set
(col_id
,"AU_LANGUAGE"
,lang_id
)
call dcol_set
(col_id
,"AU_BUSINESS"
,business_id
)
call dcol_set
(col_id
,"AU_CONTACT"
,contact_id
)
call dcol_set
(col_id
,"CONTACT_MAIL"
,cmail
)
call dcol_set
(col_id
,"SUP_MAIL"
,smail
)
call dcol_set
(col_id
, "OPN_COMMAND"
, "
call OpenFormTop('ptEdit','AU_CONTACT_E.FM','WORK.AU_CONTACT',1,'"
,contact_id
,"=AU_CONTACT'
)"
)
itm_id = dcol_additem
(col_id
)
call dcol_setitem
( itm_id
, "FLD_PROMPT"
, "Full Name"
)
call dcol_setitem
( itm_id
, "FLD_NAME"
, "AU_CONTACT.DISP_NAME"
)
call dcol_setitem
( itm_id
, "FLD_VALUE"
, name
)
call dcol_setitem
( itm_id
, "REC_NAME"
, "AU_CONTACT"
)
call dcol_setitem
( itm_id
, "REC_ID"
, contact_id
)
call dcol_setitem
( itm_id
, "OPN_COMMAND"
, "
call OpenFormTop('ptEdit','AU_CONTACT_E.FM','WORK.AU_CONTACT',1,'"
,contact_id
,"=AU_CONTACT'
)"
)
itm_id = dcol_additem
(col_id
)
call dcol_setitem
( itm_id
, "FLD_PROMPT"
, "Role or Position"
)
call dcol_setitem
( itm_id
, "FLD_NAME"
, "AU_CONTACT.CPOSITION"
)
call dcol_setitem
( itm_id
, "FLD_VALUE"
, role
)
call dcol_setitem
( itm_id
, "REC_NAME"
, "AU_CONTACT"
)
call dcol_setitem
( itm_id
, "REC_ID"
, contact_id
)
call dcol_setitem
( itm_id
, "OPN_COMMAND"
, "
call OpenFormTop('ptEdit','AU_CONTACT_E.FM','WORK.AU_CONTACT',1,'"
,contact_id
,"=AU_CONTACT'
)"
)
itm_id = dcol_additem
(col_id
)
call dcol_setitem
( itm_id
, "FLD_PROMPT"
, "Email Address"
)
call dcol_setitem
( itm_id
, "FLD_NAME"
, "AU_CONTACT.MAIL"
)
call dcol_setitem
( itm_id
, "FLD_VALUE"
, cmail1
)
call dcol_setitem
( itm_id
, "REC_NAME"
, "AU_CONTACT"
)
call dcol_setitem
( itm_id
, "REC_ID"
, contact_id
)
call dcol_setitem
( itm_id
, "OPN_COMMAND"
, "
call OpenFormTop('ptEdit','AU_CONTACT_E.FM','WORK.AU_CONTACT',1,'"
,contact_id
,"=AU_CONTACT'
)"
)
itm_id = dcol_additem
(col_id
)
call dcol_setitem
( itm_id
, "FLD_PROMPT"
, "Phone Number"
)
call dcol_setitem
( itm_id
, "FLD_NAME"
, "AU_CONTACT.OFFICE_TEL"
)
call dcol_setitem
( itm_id
, "FLD_VALUE"
, phone
)
call dcol_setitem
( itm_id
, "REC_NAME"
, "AU_CONTACT"
)
call dcol_setitem
( itm_id
, "REC_ID"
, contact_id
)
call dcol_setitem
( itm_id
, "OPN_COMMAND"
, "
call OpenFormTop('ptEdit','AU_CONTACT_E.FM','WORK.AU_CONTACT',1,'"
,contact_id
,"=AU_CONTACT'
)"
)
itm_id = dcol_additem
(col_id
)
call dcol_setitem
( itm_id
, "MN_DESCR"
, "Do not s
end me email again"
)
call dcol_setitem
( itm_id
, "MN_CODE"
, "M001"
)
call dcol_setitem
( itm_id
, "MN_VALUE"
, "0"
)
itm_id = dcol_additem
(col_id
)
call dcol_setitem
( itm_id
, "MN_DESCR"
, "What is kosmos/BOS
(Business Operating System
)"
)
call dcol_setitem
( itm_id
, "MN_CODE"
, "M002"
)
call dcol_setitem
( itm_id
, "MN_VALUE"
, "0"
)
call dcol_
end(col_id
)
endif
if (ctype = "BUSINESS_FIELDS"
) then
str = SelectFrom
("
SELECT DISP_NAME
, CPOSITION
, MAIL
, OFFICE_TEL
FROM AU_CONTACT
WHERE (AU_CONTACT="
,contact_id
,"
)"
)
name = GetSQLSelectItem
(str
,1
)
role = GetSQLSelectItem
(str
,2
)
cmail1 = GetSQLSelectItem
(str
,3
)
phone = GetSQLSelectItem
(str
,4
)
col_id = dcol_start
(comm
)
call dcol_set
(col_id
,"MAIL_SUBJECT"
,subj
)
call dcol_set
(col_id
,"AU_PROCESS"
,__au_process
)
call dcol_set
(col_id
,"AU_LANGUAGE"
,lang_id
)
call dcol_set
(col_id
,"AU_BUSINESS"
,business_id
)
call dcol_set
(col_id
,"AU_CONTACT"
,contact_id
)
call dcol_set
(col_id
,"CONTACT_MAIL"
,cmail
)
call dcol_set
(col_id
,"SUP_MAIL"
,smail
)
call dcol_set
(col_id
, "OPN_COMMAND"
, "
call OpenFormTop('ptEdit','AU_CONTACT_E.FM','WORK.AU_CONTACT',1,'"
,contact_id
,"=AU_CONTACT'
)"
)
itm_id = dcol_additem
(col_id
)
call dcol_setitem
( itm_id
, "FLD_PROMPT"
, "Full Name"
)
call dcol_setitem
( itm_id
, "FLD_NAME"
, "AU_CONTACT.DISP_NAME"
)
call dcol_setitem
( itm_id
, "FLD_VALUE"
, name
)
call dcol_setitem
( itm_id
, "REC_NAME"
, "AU_CONTACT"
)
call dcol_setitem
( itm_id
, "REC_ID"
, contact_id
)
call dcol_setitem
( itm_id
, "OPN_COMMAND"
, "
call OpenFormTop('ptEdit','AU_CONTACT_E.FM','WORK.AU_CONTACT',1,'"
,contact_id
,"=AU_CONTACT'
)"
)
itm_id = dcol_additem
(col_id
)
call dcol_setitem
( itm_id
, "FLD_PROMPT"
, "Role or Position"
)
call dcol_setitem
( itm_id
, "FLD_NAME"
, "AU_CONTACT.CPOSITION"
)
call dcol_setitem
( itm_id
, "FLD_VALUE"
, role
)
call dcol_setitem
( itm_id
, "REC_NAME"
, "AU_CONTACT"
)
call dcol_setitem
( itm_id
, "REC_ID"
, contact_id
)
call dcol_setitem
( itm_id
, "OPN_COMMAND"
, "
call OpenFormTop('ptEdit','AU_CONTACT_E.FM','WORK.AU_CONTACT',1,'"
,contact_id
,"=AU_CONTACT'
)"
)
itm_id = dcol_additem
(col_id
)
call dcol_setitem
( itm_id
, "FLD_PROMPT"
, "Email Address"
)
call dcol_setitem
( itm_id
, "FLD_NAME"
, "AU_CONTACT.MAIL"
)
call dcol_setitem
( itm_id
, "FLD_VALUE"
, cmail1
)
call dcol_setitem
( itm_id
, "REC_NAME"
, "AU_CONTACT"
)
call dcol_setitem
( itm_id
, "REC_ID"
, contact_id
)
call dcol_setitem
( itm_id
, "OPN_COMMAND"
, "
call OpenFormTop('ptEdit','AU_CONTACT_E.FM','WORK.AU_CONTACT',1,'"
,contact_id
,"=AU_CONTACT'
)"
)
itm_id = dcol_additem
(col_id
)
call dcol_setitem
( itm_id
, "FLD_PROMPT"
, "Phone Number"
)
call dcol_setitem
( itm_id
, "FLD_NAME"
, "AU_CONTACT.OFFICE_TEL"
)
call dcol_setitem
( itm_id
, "FLD_VALUE"
, phone
)
call dcol_setitem
( itm_id
, "REC_NAME"
, "AU_CONTACT"
)
call dcol_setitem
( itm_id
, "REC_ID"
, contact_id
)
call dcol_setitem
( itm_id
, "OPN_COMMAND"
, "
call OpenFormTop('ptEdit','AU_CONTACT_E.FM','WORK.AU_CONTACT',1,'"
,contact_id
,"=AU_CONTACT'
)"
)
itm_id = dcol_additem
(col_id
)
call dcol_setitem
( itm_id
, "MN_DESCR"
, "Do not s
end me email again"
)
call dcol_setitem
( itm_id
, "MN_CODE"
, "M001"
)
call dcol_setitem
( itm_id
, "MN_VALUE"
, "0"
)
itm_id = dcol_additem
(col_id
)
call dcol_setitem
( itm_id
, "MN_DESCR"
, "What is kosmos/BOS
(Business Operating System
)"
)
call dcol_setitem
( itm_id
, "MN_CODE"
, "M002"
)
call dcol_setitem
( itm_id
, "MN_VALUE"
, "0"
)
call dcol_
end(col_id
)
endif
call mail_createands
end ( "immediately"
, "single"
, rec_id
, cmail
, contact_id
, business_id
)
{...................stay ready
to wait
for a mail / res
end a new mail............}
if (res
end_flag = 1
) then
call bpm_setprocess
(__au_process
)
comm = LookUpId
("AU_CONTACT"
,contact_id
,"DISP_NAME"
)
call bpm_setstepcomment
(comm
)
call bpm_event
( "Wait
for Mail"
, rec_id
, rec_itm_id
, col_id
, cmail
)
{...................requery database
to get variables..........}
start_sql "*" "KOSMOS"
SELECT AU_POS.POS_D
, AU_USER.UNAME
, AU_MAILCAMP.*
FROM (AU_MAILCAMP
LEFT JOIN AU_POS
ON AU_MAILCAMP.AU_POS = AU_POS.AU_POS
)
LEFT JOIN AU_USER
ON AU_MAILCAMP.AU_USER = AU_USER.AU_USER
WHERE (AU_MAILCAMP = :MC
)
end_sql
q = QueryByName
()
call TSetParam
(q
,"MC"
,rec_id
)
call TExecute
(q
)
business_id = TGetFld
(q
,"AU_BUSINESS"
)
contact_id = TGetFld
(q
,"AU_CONTACT"
)
__au_process = TGetFld
(q
,"AU_PROCESS"
)
comm = TGetFld
(q
,"SUBJECT"
)
subj = TGetFld
(q
,"MSUBJECT"
)
cmail = TGetFld
(q
,"CMAIL"
)
smail = TGetFld
(q
,"SMAIL"
)
draft = TGetFld
(q
,"DRAFT_FLAG"
)
sched = TGetFld
(q
,"SCHED_FLAG"
)
date = TGetFld
(q
,"SDATE"
)
ctype = TGetFld
(q
,"COLL_TYPE"
)
uname = TGetFld
(q
,"UNAME"
)
rname = TGetFld
(q
,"POS_D"
)
html_file = TGetFld
(q
,"HTML_FILE"
)
lang_id = LookUpId
("AU_CONTACT"
,contact_id
,"AU_LANGUAGE"
)
lang_c = LookUpId
("AU_LANGUAGE"
,lang_id
,"AU_LANGUAGE_C"
)
call FreeEmbSQL
(q
)
start_sql "*" "KOSMOS"
INSERT INTO AU_MAILCAMP_ITM
end_sql
q = QueryByName
()
call TSetFld
(q
,"AU_MAILCAMP"
,"String"
,rec_id
)
call TSetFld
(q
,"CMAIL"
,"String"
,cmail
)
call TSetFld
(q
,"MSUBJECT"
,"String"
,subj
)
call TSetFld
(q
,"COLL_TYPE"
,"String"
,ctype
)
call TSetFld
(q
,"DRAFT_FLAG"
,"String"
,draft
)
call TSetFld
(q
,"SCHED_FLAG"
,"String"
,sched
)
call TSetFld
(q
,"SDATE"
,"Date"
,date
)
call TSetFld
(q
,"AU_CONTACT"
,"Float"
,contact_id
)
call TExecute
(q
)
call FreeEmbSQL
(q
)
rec_itm_id = SelectLastId
("AU_MAILCAMP_ITM"
)
call bpm_setprocess
(__au_process
)
d2 = crDate
d2 = DateToNum
(d2
)
d2 = d2 + 15
d2 = NumToDate
(d2
) {....res
end every 15 days!!!}
call bpm_setsteptofindate
(d2
)
call bpm_setstepmonitor
(1
)
comm = LookUpId
("AU_CONTACT"
,contact_id
,"DISP_NAME"
)
call bpm_setstepcomment
(comm
)
call bpm_setstepcontact
(contact_id
)
call bpm_assign_job
( "Res
end Mail"
, uname
, rname
, 0
, rec_id
, rec_itm_id
, col_id
)
endif
return
endif
if (mode = "INSPECT_INBOUND_MAIL"
) then
rec_id = __params[2]
rec_itm_id = __params[3]
col_id = __params[4]
call bpm_setprocess
(__au_process
)
call bpm_setstepmonitor
(1
)
call bpm_setstepcontact
(contact_id
)
comm = LookUpId
("AU_CONTACT"
,contact_id
,"DISP_NAME"
)
call bpm_setstepcomment
(comm
)
call bpm_assign_job
( "Mail Arrived"
, uname
, rname
, 0
, rec_id
, rec_itm_id
, col_id
)
endif
{ calls
to "DATA_SUBMITED" are made automaticaly by the mail manager upon the arrival of a submiting mail }
if (mode = "DATA_SUBMITED"
) then
rec_id = __params[2] {AU_MAILCAMP}
col_id = __params[3] {AU_DATACOLLECT}
cmail = __params[4] {...receiving mail}
subj = __params[5] {...receiving mail subject}
html_file = "AU_DATASUBMCONF_EN_M.HTM"
if (lang_c = "EN"
) then
subj = strcat
(subj
," - Thank you
for data submision"
)
html_file = "AU_DATASUBMCONF_EN_M.HTM"
endif
if (lang_c = "EL"
) then
subj = strcat
(subj
," - Ευχαριστω για την καταχωρηση"
)
html_file = "AU_DATASUBMCONF_EL_M.HTM"
endif
call mail_createands
end ( "after_receiving"
, cmail
, smail
, subj
, __au_process
, "1"
, "1"
, crDate
, html_file
, col_id
)
endif
{ calls
to menu selections "M*" are made automaticaly from mail manager }
{ "after_receiving" because menu selections activated from the mail receive thread!!}
if (mode = "M001"
) then
if (lang_c = "EN"
) then
subj = "You will not receive any mail"
html_file = "AU_NOMAILS_EN_M.HTM"
endif
if (lang_c = "EL"
) then
subj = "Δεν θα λαβετε πλεον άλλα μαίιλ"
html_file = "AU_NOMAILS_EL_M.HTM"
endif
call UpdateField
("AU_CONTACT"
,contact_id
,"NOMAILS"
,"1"
,""
) {.....contact
does not wand mails}
call trace
("M001="
,"Sorry
for the mails"
)
call mail_createands
end ( "after_receiving"
, cmail
, smail
,subj
, __au_process
, "1"
, "1"
, crDate
, html_file
)
{....FINISH THE PROCESS HERE}
return
endif
if (mode = "M002"
) then
call trace
("M002="
,"Autopilot in Hellenic"
)
html_file = "AU_AUTOPILOT_LEAFLET_EL.HTM"
call mail_createands
end ( "after_receiving"
, cmail
, smail
,"Autopilot in Hellenic"
, __au_process
, "1"
, "1"
, crDate
, html_file
)
return
endif
if (mode = "FINISH"
) then
return
endif
end_action