Hi community
I am designing an email template that'll be triggered based on an event with some real-time event context carrying parameters. We want the template to be able to accept and show some dynamic content via these events such as bulleted lists of items, but as far as I can tell the event context is pretty flat in terms of delivering data, only allowing properties. The caller of the event will produce some quite dynamic content, so we find it hard to have to design a very large variety of templates to fit every need.
Our initial idea was to somehow, if possible, insert the data from the real-time event in the template but allow it to be rendered directly as HTML inside the template. Basically reserving an area of the template where the caller could "inject" some specifically styled content. That way, the caller of the event could send along some simple HTML structured data, no styling, just structure, and that would be rendered nicely in the resulting email.
I cannot seem to determine if that is at all possible or just a dead end and we should be looking for another solution (which we would love to get ideas for as well).
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @sorenenemaerke,
I think you can achieve this using data collection and visibility conditions in a transactional messaging setup. Probably have a field in the data structure that will identify the data collection to render the payload data. For example, let's say order confirmation has 3 different variants (ship to address, ship to store, and POS). Have a field in the data structure something like order confirmation type to identify one of three variants that will be included in the payload from an external system. Create three different collections and define the data fields for each collection. When you create an email within the structure component set the visibility condition to show relevant collection data according to the order confirmation type.
Let me know if this helps.
Hi SatheeskannaK
Thanks for responding. I am not a regular user of ACS, so apologies for any misunderstandings. I think you are suggesting defining a set of templates and some logic to pick the correct one or maybe even some logic inside the template to determine if a section is to be shown. I don't think that'll fit our purpose.
Let me try to explain our setup as best I can: We have a main processing system that handles user "orders". We would like to trigger an email to the user once processing is completed and have some order contextual data included in that email. However, the data we want to include in that email is quite dynamic, things like the steps taken in the processing (which will be a dynamic list of steps), the results of the steps (which is also a dynamic list and might include links to documents) and a textual description that may be quite dynamic (could essentially be html). With our current setup, inside ACS we define an event with a number of named fields to describe some data and then we can POST a json body towards ACS with that event data and have a transactional message template where we can insert a personalized field that grabs a named field from the event context on the triggered event data.
What we want to do is to create an event with one or more named fields that will essentially contain HTML structured data/text. And in the message template we want to insert a block/personalized field from such a named field and have that "just" be rendered directly as HTML. I understand that there might be some security issues surrounding rendering HTML directly from the event context, but we feel we have tight control over the generation of that HTML in the main processing system.
Is something like that possible? Or are there other ways to define events that contain more complex data and use that in data templates?
Views
Replies
Total Likes
Hi @sorenenemaerke,
Were you able to resolve this query on your own or do you still need more help here? Do let us know.
Thanks!
Views
Replies
Total Likes
Hi there
No, I have not been able to resolve my issue so my request for advise on how to handle more complex data structures defined by the event context models in a template is still valid. Please see my first reply above/below for a longer explanation of my issue. Any assistance would be appreciated
Thanks
Søren
Views
Replies
Total Likes
Thanks for sharing that. I will escalate it further among SMEs and try to get you more help here.
Best,
Sukrity
Views
Replies
Total Likes
Hi @Sukrity_Wadhwa - Any update on this?
Views
Replies
Total Likes
Views
Likes
Replies