1
0
-1

Goal: Dynamically email a selected User with the email Plugin

Description: A person will select an existing user in a form (User Options Binder + Select Box), which is passed via a Workflow Variable into a process, and the email Plugin will send an email to the selected user.

Why: I want the Datalist (or Universal) inbox to be supplemented by an email "reminder" to check Joget

General Design
1. Form:

Then if the user wants to send the form to Jack (and Jack gets a reminder), they pick them and hit submit (note: I simplified the form ... it could be like the travel approval example):

2. Process:

At this point the workflow variable is mapped to the "PT Monitor" Form/Datalist Inbox AND it would send an email. (ignoring the rest of the Process/Workflow example – but again see the Travel Approval Examples). NOTE: The Cycle for the PT Monitor Rejecting and Member "re-submitting works".

However, I will note that the PT Monitor is mapped as the Workflow Variable... but the System is not:

And:



3. Configuring the Email Plugin.
Thus I'm trying to email the PT Monitor, CC the user (aka the Member) ... which stems from selection from the person in the form ---^ :


In this case, I'd expect the user I logged in as to get the CC, and "Jack Drake" to receive the email.

Any thoughts? Thanks!

    CommentAdd your comment...

    4 answers

    1.  
      2
      1
      0

      In my opinion, you should use the form hash variable in the email tool.

      E.g. use #form.yourtablename.prt_fm_SubmitWk_PTMonitor# for the To(Specific email address) and vice versa for the CC.

      With this, you will not need to configure any workflow variable and you only need to make sure that the users have already set their emails in their profile.

      This is a simple app that I have created using this concept.
      Login as Admin and click run process after making sure that the users have set their emails.
      APP_basicEmail-1-20210915121037.jwa

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

        For now I've made Reid's Answer (plus some of my screenshots) as "Accepted"

        The real answer is DON'T use the Workflow Variable (for the concerns with the email – you STILL MIGHT want to use it for the Process/Workflow!) for the email. Simply and directly access the Form's object via a form hash variable.

        (To play Devil's Advocate – this is NOT addressed in the Hash Variable's examples: https://dev.joget.org/community/display/DX7/Hash+Variable#HashVariable-FormDataHashVariable – Unless someone else sees it.)

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

          More on #1 (and Reid's WHOLE point ... (big grin)):
          A) The Workflow/Process:


          B) Form Design



          So on the design: (0) there's NO source/SQL like I had in my #1 above,  (1) the Joget users are still all pulled [GREAT to me!], (2) there's no orgs/groups [so this will list ALL the users – which can be easily configured], and (3) there's NO workflow variable (to Reid's point – which is ALSO great!)

          Thus, I think this solve my problem. The Theory is sound – I just have to go make a quick App on my properly configured server to test. I'll come back with the final result!


          Thanks again!

          Edit: For posterity here's Reid's Email Configuration:

          1. fro

            As an update – Reid's method did WORK! I also leveraged it to use the "nested" variables.

            For instance if you know the "form variable" that hosts the User name (e.g., form.<FORM NAME>.<FORM OPTION ID>.username), then you can use that in a nested username (e.g., user.<USERNAME>.__Option__).

            Thus, I had things like: #user.{form.yourtablename.prt_fm_SubmitWk_PTMonitor.username}.fullName#, because the Datalist would store the username ... which I could use for subsequent emails/Userviews/etc. (for example I stole the name, used a Form Update Plugin, with a hidden variable, and could place the username AND the full name into the form entry – BUT I did have to use a workflow variable in that case...)

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

          Hey Reid!

          1) Thank you for your response and example,I'll look into that in a second.

          2) I did some initial research this week, but with the Tutorial App: Hash Variable on The Joget Marketplace [link].

          What I found was their implementation of the form hash variable only worked by statically loading the WHOLE user database table, into a local datalist via an SQL query.



          Then, like your suggestion: it will pull the selection box user/workflow variable from the local datalist:




          If your example is NOT doing this, then it could be just what I need. However, if it follows #2 here ... then it seems like extra work (either in SQL queries running to pull the userlist or a duplication of the User Option Binder which already exists).


            CommentAdd your comment...