0

I have created & called a custom service in my custom template to send mails to users when document gets sent/reject/approve. I want to copy myself in BCC in these mails so that in case of any issues, i could cross check. is there a way i can enter a specific mail address in this code. below is the code i 'm using. Will "wfNotify" be of any help?

code used

<$executeService("APPROVAL_MAIL_PILOT_USERS")$>
<$loop IS_PILOT_USER$>
<$userValue=IS_PILOT_USER.USEREXISTS$>
<$endloop$>
<$if strEqualsIgnoreCase(userValue,"1")$>

            ----MailFormat----

P.S- when i use wfNotify -> , i get the error

Caused by: intradoc.common.ServiceException: !csScriptMustBeInWorkflowContext,wfNotify
    *ScriptStack !csDynHTMLStackDumpStart,pbhati,(datasummary)IdcService=WORKFLOW_SENDTO\,dDocName=D_1247583\,dID=1421894!$
!csDynHTMLNoStack!$
!csDynHTMLErrorMessage,/u01/Oracle/Middleware/user_projects/domains/base_domain/ucm/cs/custom/Workflow/templates/Workflow_reviewer_mail.htm,44,3!csDynHTMLReportMsgFunction,wfNotify!$
    -><$wfNotify(xDocOwner,"user")$>
Pulkit Bhatia
  • 127
  • 1
  • 7
  • 22

2 Answers2

2

As far as I know, wfNotify can only be called from inside a workflow event which is why you are receiving the csScriptMustBeInWorkflowContext error.

As to a service or Idoc Script function (besides wfNotify) that can be used to send an email to a specific user/alias/token and use a custom template, I could not locate one.

You could create your own scriptable service (which you can then call from Idoc Script) or an Idoc Script function that would allow for this.

Jonathan Hult
  • 1,351
  • 2
  • 13
  • 19
0

You can call wfNotify with the specific username. But the user must have their email details completed in the user table.

Your second error with the wfNotify call - are you calling wfNotify with a 3rd param for the template? If so - eliminate this as a source of your problem by just calling wfNotify with the first two params.

wfNotify Oracle Documentation

OraNob
  • 684
  • 3
  • 9
  • I have tried both the wfNotify options,as below,but still gets the error as stated before.<$wfNotify(xDocOwner,"user")$> or <$wfNotify("user","user")$> – Pulkit Bhatia Mar 19 '14 at 11:44
  • Have you configured the email server? Turn on the logging and capture the errors from the services. – OraNob Mar 19 '14 at 12:42
  • YES, email server is correctly configured and i'm receiving mails in other cases. Detailed error traces...!csMailFailed,ucm1@norelay.com java.io.IOException: !csDynHTMLReportMsgFunction,wfNotify..Caused by: intradoc.common.ServiceException: !csScriptMustBeInWorkflowContext,wfNotify *ScriptStack !csDynHTMLStackDumpStart,pbhati,(datasummary)IdcService=WORKFLOW_SENDTO\,dDocName=D_1247583\,dID=1421894!$ !csDynHTMLNoStack!$ !csDynHTMLErrorMessage,/u01/Oracle/Middleware/user_projects/domains/base_domain/ucm/cs/custom/Workflow/templates/Workflow_mail.htm,232,3!csDynHTMLReportMsgFunction,wfNotify!$ – Pulkit Bhatia Mar 20 '14 at 04:47
  • :) yes. the contents are in a workflow. Any other way, i can get to my goal?? – Pulkit Bhatia Mar 20 '14 at 09:51
  • You should be able to access the service WORKFLOW_SENDTO directly from a browser. Try testing and running it from there. – OraNob Mar 20 '14 at 11:46