Velocity variables for email templates - New Account Provisioned

Are we able to get the attribute data from the source, such as sAMAccountName? I’m seeking to send an email on an account creation and include source specific data from AD.

The documentation does not reference anything specific as to source attributes.

New Account Provisioned Email Template - SailPoint Identity Services

On a second note, I tried to reference an identity attribute and it ended up dumping all attributes in the email. I have an IDN attribute called displayName. In the template I called “$identity.displayName” This ended up dumping all of the data. When I modify it to: “$identity.firstname $identity.lastname” it worked just fine.

Since the account object isn’t available you will have to map those account attributes to Identity attributes and then use them in the email template.

1 Like

I’m not able to pull in the IDN attribute. I have samaccountname stored in IDN, but I can’t call it like I can firstname and lastname. I also have mail and I try to parse it but get errors, the $parts attribute doesn’t evaluate. Any idea on why some IDN attributes I can’t grab? Any ideas on how to parse the email?

Hello,

The ${PRODUCT_NAME} system has created an account for $identity.firstname $identity.lastname on the ${source} system.

#set($parts = $identity.email.split('@'))

User ID: $parts[0]

Email address: $identity.email

Access:
#foreach ($access in $accountAccess)

* $access

#end

If the User ID is your sAMAccountName, you can directly get it using ${accountUserName}.

You can use identity attributes in the template by specifying their technical name as mentioned in the Identity Profile.

So, for whatever reason it is working now. Below is hopefully my final revision. The odd thing to me is knowing when to enclose the attribute name in the curly braces {}. I also don’t know why my prior post, the #set statements didn’t produce the same output. I also don’t know why some IDN attributes do not write out, when others do.

Hello,
The ${PRODUCT_NAME} system has created an account for $identity.firstname $identity.lastname on the ${source} system. 



User ID: ${accountUserName}

Email address: $identity.email

Access:
#foreach ($access in $accountAccess)

$access

#end

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.