book
Article ID: KB0087547
calendar_today
Updated On:
Description
Resolution:
Custom rule to send a file:
ictl_mail_file(ToPoolName, MessageString) :-
ricPool_getPoolNamed(ToPoolName, ToPoolObject),
ictl_getCurrentTask(TaskObject),
icrl_mail_file(TaskObject, ToPoolObject, MessageString),
ictl_complete. % complete fires the trigger, sending the mail
icrl_mail_file(TaskObject, PoolObject, MessageString) :-
icrl_mailCreateEventSpec(TaskObject, EventSpecObject),
icrl_mailCreateActionSpecFile(PoolObject, MessageString, ActionSpecObject),
ricTrigger_create(EventSpecObject, ActionSpecObject, $IcRules Mail Trigger$, Trigger).
icrl_mailCreateActionSpecFile(PoolObject, MessageString, ActionSpecObjectOut) :-
ic_enum(actionMailFormat, file, MailFormat), % we are going to mail the message string
ricActionSpec_createSendMail(PoolObject, MailFormat, MessageString, ActionSpecObjectOut).
%% generic version, passing in ActionType = {file, string, etc. }
ictl_mail_generic(ToPoolName, ActionType, MessageString) :-
ricPool_getPoolNamed(ToPoolName, ToPoolObject),
ictl_getCurrentTask(TaskObject),
icrl_mail_generic(TaskObject, ToPoolObject, ActionType, MessageString),
ictl_complete. % complete fires the trigger, sending the mail
icrl_mail_generic(TaskObject, PoolObject, ActionType, MessageString) :-
icrl_mailCreateEventSpec(TaskObject, EventSpecObject),
icrl_mailCreateActionSpecGeneric(PoolObject, MessageString, ActionType, ActionSpecObject),
ricTrigger_create(EventSpecObject, ActionSpecObject, $IcRules Mail Trigger$, Trigger).
icrl_mailCreateActionSpecGeneric(PoolObject, MessageString, ActionType, ActionSpecObjectOut) :-
ic_enum(actionMailFormat, ActionType, MailFormat), % we are going to mail the message string
ricActionSpec_createSendMail(PoolObject, MailFormat, MessageString, ActionSpecObjectOut).
Issue/Introduction
How do I send a file as an attachment using IcRule?