Get request data in EmailTemplate

I am editing the emailTemplate lauched on create identities to send the firstName and lastName of the new user on the body.
We cannot use getObjectbyName because at this point the identity does not yet exist.

How do we get the request/form data to print in the email?
e.g. department, first name, last name…

Thanks!!!

any help?

Hello  @ricardo_s_araujo

If you are using OOTB workflow of Create Identity and If you do not want to make any changes to the workflow then please use “plan” object in email template to loop through attribute requests and print value in the template but If you have an option to make changes in workflow then you can put all required values in a map and pass it as an argument and print the same values in email template.

We send a notification in Joiner event when the plan is created, maybe it will help you as a reference.
Joiner.xml (4.61 KB)

Hello Ricardo

You can either get values from plan or accountrequest as mentioned below:-

<ul>
<li><strong>First Name:</strong> $accountRequest.attributes.get(“firstName”)</li>
<li><strong>Last Name:</strong> $accountRequest.attributes.get(“lastName”)</li>
<li><strong>Department:</strong> $accountRequest.attributes.get(“department”)</li>
</ul>

Otherwise if you have some request object which has these values then you can set it as emailoptions and then get it as argument in email template as provided below:-

Rule Code:-

Map mArgs = new HashMap();

mArgs.put(“firstname”, “ABC”);
mArgs.put(“lastname”, “XYZ”);

EmailOptions ops = new EmailOptions(recipients, mArgs);

Email Template Code:-

Request Details:
First Name: $firstname
Last Name: $lastname

<Signature>
<Inputs>
<Argument name=“firstname” type=“string”>
<Description>firstname of identity</Description>
</Argument>
<Argument name=“lastname” type=“string”>
<Description>lastname of identity</Description>
</Argument>
</Inputs>
</Signature>
<Subject>Notification</Subject>
</EmailTemplate>