If else statement is not working in user password changes email template as expected

We have built an if else case in the body and it is not working as expected, need help in this
#if(${user.brand} != " " && ${user.brand} != "default")
${user.brand} user password has been updated successfully.
#else 
${user.brand} user password not updated.
#end

HI @bkumar592 ,

Can you try below? Just a small change to else condition.

We have built an if else case in the body and it is not working as expected, need help in this
#if(${user.brand} != " " && ${user.brand} != "default")
${user.brand} user password has been updated successfully.
#{else}
${user.brand} user password not updated.
#end

Thanks for the reply, but not luck it is not going to if statement

If you tring to get Identity attribute brand, wouldn’t that be ${identity.brand}??

Hello Narendra,
You should use "" (empty string) instead of " " (which is a space). So the comparison #if (${user.brand} != "") ensures you’re checking if the brand field is not empty.

2 Likes

Make sure the brand attribute is present and available. Try using two if instead of using && as shown in the similar documentation. Hope that will get you as desired.

Example From Documentation:


<!-- The source failed to update and the source has no apps for this user. -->
#if (${sourceFailedCount}) #if (${sourceFailedCount} > 0)
<!-- If no sources were updated, use the other sentence. -->
#if (${appCount} > 0)
<p>However, your password failed to update for all the systems that share the password.</p>
#else
<p>Your password failed to update.</p>
#end #end

Hi @anagha Thanks for the reply, we have tried your inputs but still it is going into else statements only
Thanks

Hi Kapil,
Thanks for the reply, we tried using only one if statement with out && condition but still we are seeing that it is always going into else condition.
Thanks
Narendra

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