Does identity attributes are available in Email Template?

Hey Team,

I’m trying to write following email template but it is not working… Can someone confirm is " identity attributes are available in Email Template"?

Dear ${user.name},

#if(${identity.workerType.equalsIgnoreCase('EMP')})
  Employee ${identityName}'s status has changed to $newState.
#end

#if(${identity.workerType.equalsIgnoreCase('NoN-EMP')})
    NoN-Employee ${identityName}'s status has changed to $newState.
#end

Thanks,
The ${PRODUCT_NAME} Team

I found that ${identity.workerType} evaluating it’s value as EMP

Dear ${user.name},

${identity.workerType}

The ${PRODUCT_NAME} Team

Seems like String comparison is a issue? ${identity.workerType.equalsIgnoreCase('EMP')} it is not evaluating to true?

okay, syntactical issues, following syntaxes solved the issues but it is case sensitive string comparison. still searching if I can use equalsIgnoreCase

Dear ${user.name},

#if(${identity.workerType} == 'EMP')
  Employee ${identityName}'s status has changed to $newState.
#end

#if(${identity.workerType} == 'Non-EMP')
    NoN-Employee ${identityName}'s status has changed to $newState.
#end

Thanks,
The ${PRODUCT_NAME} Team

Hi @Swapnil_Kotwal ,

Identity attributes are available in email template by using user..

for if condition, equalsIgnoreCase is not allowed. you can check for both caps & small case letter by putting a OR as below:
#if(${identity.workerType} == ‘Non-EMP’ || ${identity.workerType} == ‘non-emp’ )

3 Likes