Forum Discussion
Thanks for the reply, Christian. Yes, I was testing by sending the test email to myself from Studio. I see now what you are saying -- I'm always returning the most recently active board when doing this test. Email notifications from stage aren't working anymore, otherwise I could test this properly. It's possible that ${coreNode.title} is correct when the email template has some context to work with.
I did try adding ${coreNode.ancestors} to the template, and the result returned:
[lithium.eval.velocity.CoreNodeTemplateModel@a54cc6b8,
lithium.eval.velocity.CoreNodeTemplateModel@e490cafc,
lithium.eval.velocity.CoreNodeTemplateModel@76850eb6]
:catsurprised:
I assume this occurred because that's a FreeMarker context object, and only Velocity context objects should be used in email templates.
Thanks,
Lili
I haven't found a good way to obtain the category/categories for a content pice so far. The closest that takes you there is indeed tracing along the ancestors and checking the node type for each of the ancestor: https://community.lithium.com/t5/Developers-Discussion/Get-ID-of-current-category/m-p/125151
Which does not work too well in the email template Velocity environment :(
${notification.message}
might return a message context object like documented in https://freemarker-docs-portal.lithium.com/refer/contextObjects#message but even that won't bring you far in obtaining the category.
Maybe you can work around by hiding the category in some short / long description field of the board (depending on whether you not surface this description somewhere in your community UI)?
Related Content
- 2 years ago
- 2 years ago
- 5 years ago