Forum Discussion
There is no context objects for "Settings List Editor" values. We can fetch the values using API v1 and v2, but this will not help in you case.
Hey Parshant. Thanks for the reply.
1. So if I can get the values using V1 or V2 is there any possibility that by writing them in the template HTML, can I get the data and do what is required? Actually, I have to get some comma separated values from the settings and then if any of these values match some other values already present in the template code I have to run some freemarker code.
2. While looking for answers, on the page in the studio where we see email templates I have stumbled upon two things or settings SettingByNameTemplateWrapper and SettingsByNameLocalTemplateWrapper both stating :
Now I don't know if you have worked on Velocity but if you think that these will work and there is a way (a snippet basically as I am using it the wrong way) I can use them and if you can share it with me then that will be very helpful to me.
- snaffle6 years agoExpert
We've done some quite extensive customisations of the email template but as far as I know there's no way of running Freemarker inside them, you're limited to the available context objects which can you view underneath the templates themselves in Studio... Related discussion here - https😕/community.khoros.com/t5/Developer-Knowledge-Base/Email-template-context-objects/ta-p/75924
One thing we did work out though was that it could be personalised to an extent... we had some custom user profile fields that we wanted to display in the emails which we were able to do by defining a Velocity variable at the start of the template as so:
#set($user_custom_field = ${user.get("custom.profile.custom_field")})
We could then display the contents of the custom field in the email body.
Would really be super useful if there was a way of querying the API in the templates though.
- pp_016 years agoMentor
Hey Snaffle, thanks for sharing the knowledge. Do you think it is possible to use a community-wide custom setting from the SLE in the place of custom.profile.custom_field which you are getting in your Velocity variable with the Settings context objects given on the Email Templates page? Something like this for an example :
#set($user_custom_field = ${SettingByNameTemplateWrapper.get("custom.nav.event_items")})
TEST1 : $user_custom_field
OR
#set($user_custom_field1 =
${SettingsByNameLocalTemplateWrapper.get("custom.nav.event_items")})TEST2 : $user_custom_field1
Because it is not working for me. Am I doing something wrong while printing it or the above mentioned context objects are not SLE context objects?
- snaffle6 years agoExpert
Hi pp_01 ,
I'm afraid I don't really no but to be honest I'd be surprised if that context object is available.
I think you could probably ask Support about that and they'd be able to find out for you or the very helpful, DougS, who pointed me in the right direction for the user context objects, might be able to chime in and answer this one.
Related Content
- 2 years ago
- 2 years ago
- 2 years ago