1
0
-1

Hi,

I'm building a collaboration job; it works at the moment, based on the default job controller. However I would like to customise the email messages to make them more relevant to the particular job.

I plan to create a custom property for the email message, but need some guidance about what objects and parameters are available.

There are some Job Task templates that refer to $jobVO and various attributes; I'm looking for more details.

Is there documentation about the jobVO?

If I create a custom message template will I have access to the $formUrl variable that is available for the 'Email Saved Form Message'?


Thanks

Mark

    CommentAdd your comment...

    3 answers

    1.  
      1
      0
      -1

      Hi Julio,

      Success!

      I managed to get this working. In the email template I was using "$formDataMap.variable", but it did not display any results.

      I finally managed to work out that I need to use "submission.formDataMap".

      So, I added the following code,


      #set ($data = $submission.formDataMap)


      then changed the template variables to be "$data.variable" and now data is displayed in the email message.

      Thanks for your help to understand this issue.

      Regards

      Mark

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Mark,

        It looks like you are trying to send an email before the form has been submitted. If the action to send the email is on Save, you can use Emailer()it will make most of the things you need.

        If you alreday have the submission, you can create a service building the email, you will need the submission id to retrieve the formxml and take anything you need from there.

        Is any of this close to what you want to achieve?


        KR,

        Julio.

        1. Mark Murray

          Hi Julio,

          thanks for the comment.

          I'm using the standard step in the job controller to assign a task. It seems that the task saves the form and also sends an email. I'd like to be able to use the details from the form to include in the email.

          The step is as follows:

          {
          "name": "Signatory Details",
          "type": "",
          "actions": [
          {
          "name": "Signatory Details",
          "type": "Job Task Assign",
          "properties": [
          { "name": "Task Assign Email", "value": "${formDataMap.signatoryEmail}" },
          { "name": "Task Form Code", "value": "add-signatory" },
          { "name": "Task Message", "value": "Please review the ${submission.formName} by ${formDataMap.signatoryFirstName} ${formDataMap.signatoryLastName}." },
          { "name": "Task Subject", "value": "Add Signatory Request - Step 1" },
          { "name": "Task Assign Portal", "value": "Beyond Bank" },
          { "name": "Task Form XML Data", "value": "$func.stepOrPreviousSubmissionXml()" },
          { "name": "Task Attachments Submission Step", "value": "Start" },
          { "name": "Task Send Email", "value": "true" },
          { "name": "Task Type", "value": "Anonymous" }
          ]
          },
          {
          "name": "Review Wait",
          "type": "Job Task Wait"
          }
          ],
          "routes": [
          { "name": "Default", "nextStep": "Owner Approval" }
          ]
          },

          It seems that the task saves the form, which triggers the "Email Saved Form Message", but I can't get the data that I want into the message template.

          So, I'm not sure if it is a timing issue, as you suggest, or whether it is an issue in terms of what data is available.

          I'd like to include some data from 'formDataMap', but the template does not insert values; when the email is received the fields are showing as the velocity template field names, like "${firstName}" and so on.

          The email is sent to the correct email address, but the message does not include the filed values.

          This job involves two actors, and the process is (in simple terms) three steps:

          • actor one opens form, edit, submit
            • system sends email to actor two
          • actor two edits form, submit
            • system sends email to actor one
          • actor one edits form, approves, submit
            • job complete, delivery service triggerred


          Thanks

          Mark

        2. Julio Berrueco

          Ok, can you please add also a screenshot from you Job Info tab in TM? There are several things,but let's start from the data you are sharing between forms. In that tab we can see  what was set as shared in the form for the job.

        3. Mark Murray

          Hi Julio,

          see screenshot attached.

        4. Julio Berrueco

          Looks good. Now, you can access to that shared data in your email. My understanding in this job is that datamap has been filled up in the first step?

        CommentAdd your comment...
      2.  
        1
        0
        -1

        Hi Mark, love your work, thanks Mark.

        Ok, I've made some progress, but still have some gaps.

        I tried $submission.isFormTaskSubmission(), but that was null.

        I have used $submission.taskSubject as a flag to show if the form is saved by a task. That works and I can display a custom message based on step 1 or step 2 of the collaboration job.

        I have also tried to get some form data but $formDataMap does not return any data, and I also tried to get $submission.formXml and that does not appear to provide any data.


        So, the question I still have is:

        • what data is available for use in the 'Email Saved Form Message' template


        Thanks

        Mark

          CommentAdd your comment...