Email templates - How to add API content
Hi everyone!
I was thinking about the newsletters that we can modify the template. The ones inside the Text editor function in the Studio tab.
Can we call the Community APIs? We would like to create a row at the bottom of the emails to give visibility to the latest post created with a cover photo and an excerpt or something similar.
I don't think I could reach that through Context object so I was wondering if someone had this similar idea and how did you manage it.
Thanks
Hey
Unfortunately not. The email templates use a different template engine "Velocity" rather than Freemarker. It's been requested a number of times, perhaps some work is being done by Khoros on this?
The best we've been able to do is create an Endpoint that produces HTML that is safe for email and we copy and paste this into a custom text string, which we then include in all our email templates.
This isn't dynamic of course but it adds "recent" content from the Community into the email template without having to update ALL the templates.
The downside is that you have to do a Studio push to update text strings.
You might consider voting for this idea
https://community.khoros.com/t5/Khoros-Communities-Ideas/dynamic-content-in-email-templates/idi-p/73980