Mail Task configuration in flowable modeler

Hi developers :slight_smile: ,
I’m new in flowable
How can I call an email of existing users in (flowable-idm) in “To” parameter ?(Dynamic email not a static email)
Capture du 2020-03-24 10-05-45

1 Like

You will need to put the user information in a process variable (e.g. user). Then you can reference it later via ${user.email} for example.

thank you for relaying
How to put user in process variable ?

We use the following expression to get the initiator’s email address for the to address where initiator is a process variable that contains the user id to look up. Note that initiator is something that we set so adapt accordingly.

${processEngine.getIdentityService().createUserQuery().userId(initiator).singleResult().getEmail()}

I’m interested in whether there may be a better way, but this works for us.

1 Like

thanks , I had tried this solution but it didn’t find the identifier of the user

“roua” is the id of the user

If your expression is:

${processEngine.getIdentityService().createUserQuery().userId(roua).singleResult().getEmail()}

you may need to put quotes around roua so it’s not evaluated as a property

${processEngine.getIdentityService().createUserQuery().userId("roua").singleResult().getEmail()}

it solved :slight_smile:
thank u

1 Like