Modify Email Template for 'Specific Users' in the 'Email Notification List' of an Identity Profile

Hi there,

I’m modifying the ‘Lifecycle State Change’ email template. In our Identity Profile provisioning, we are using the ‘Notifications’ option to notify the user’s manager and a specific additional email about the termination of a user. We need the email to be different depending on whether it’s going to the manager or the additional email.

The additional email does not need to be an identity in the system. When I try to use velocity to change the template based on the recipient, it doesn’t register, and sends the template in the ‘else’ block

Any ideas?

<p>#if($__recipient.email=='[email protected]')</p>
<first template>
<p>#{else}</p>
<second template>

Hey @margocbain!

The Lifecycle State Change email template uses the Version 1 global variables, not Version 2. __recipient is a Version 2 variable so it won’t work for this email template.

Instead, can you try something like $user.email and see if this helps? The ‘user’ variable is comprised of the email recipient’s identity data and is a Version 1 global variable.

Please let me know if this helps!

  • Zach
2 Likes

Thanks Zach, I didn’t think that user.property would help since it’s not an actual identity in the system. It looks like printing $user.name does produce [email protected] (if i directly print it), however using it in the comparison for the #if block does not catch it still.
Do you have any other ideas?
e.g.,

#if($user.email == "[email protected]")
<p>Please remove access from your assigned applications.</p>
#{else}
<p>Dear $__recipient.name,</p>
#end

My apologies, I neglected to add the curly brackets.

Can you please try this? ${user.email}

Thank you,

  • Zach

As for your comment about how that email is not tied to an identity, can you just invert the logic?

#if(${user.email} != "[email protected]")
<p>Send this body to the manager.</p>
#{else}
<p>Send this body to [email protected]</p>
#end

Hello Margo,
what I usually do is instead of modifying the actual email templates is just create a workflow based on the LCS change and, if the identity is from one location set an email different from identities from another location.

Regards,
Pablo

Thanks Zach,
We essentially just flipped the logic and added some null checks and that seems to have solved the issue. Thanks for your input.

#if($newState == 'Active')
<template 1>
#elseif($newState == 'Inactive')#if($user.email && $user.email != '[email protected]')
<template 2>
#else
<template 3>
#end#end