How can I get the client_id in my email template?
-
I'm doing some email template configuration to add some conditional statements by application_id, to customize the email by application. In the FreeMarker template, I added a hash with the values I need for each application, and at the top of the template, I create a clientId variable to use as my index.
[#assign clientId = state.client_id?string!"dafb6ef6-a2a8-4d34-9d69-59bfed3e31aa" /]
This works in some emails, but in others I get an error that the state doesn’t exist, so I can’t reference
state.client_id
.Is there a more straightforward way to get to
client_id
in an email template, so the default operator!
will work here if it doesn’t exist? Or is there a way to do some check on state first, and go straight to a default value if state doesn’t exist? -
I figured it out…. I just had to put state.client_id in parens so it resolved them together.
[#assign clientId = (state.client_id?string)!"dafb6ef6-a2a8-4d34-9d69-59bfed3e31aa" /]