09-17-2018 03:21 PM
Hi,
having large amount of activities on a daily basis a user easily gets lost in the content of activity feed e-mail notificiation.
What is the best way to group individual activities by related Site?
Outline of how notification e-mail structure should look like:
Site 1 (heading)
User1 updated Document 1 in Site 1.
User1 deleted Document 2 in Site 1.
----
Site 2 (heading)
User1 updated Document 3 in Site 2.
User2 added Document 4 in Site 2.
Thank you for any useful information in advance.
D.
09-17-2018 10:48 PM
The email template that is used to produce that notification resides in the Data Dictionary under Email Templates/activities.
In that template, you can see where the list of activities is iterated over:
<#list activities as activity>
In that loop you can see where the site ID gets referenced:
${activity.siteNetwork?html}
So, if you want to iterate over the sites in the activities collection instead of just all of the activities, you can edit the template to iterate over the activities to build a list of site IDs, then you can iterate over that list to produce the site-specific groups.
If you need help, refer to the Freemarker reference:
Jeff
09-17-2018 10:48 PM
The email template that is used to produce that notification resides in the Data Dictionary under Email Templates/activities.
In that template, you can see where the list of activities is iterated over:
<#list activities as activity>
In that loop you can see where the site ID gets referenced:
${activity.siteNetwork?html}
So, if you want to iterate over the sites in the activities collection instead of just all of the activities, you can edit the template to iterate over the activities to build a list of site IDs, then you can iterate over that list to produce the site-specific groups.
If you need help, refer to the Freemarker reference:
Jeff
07-09-2021 06:35 AM
If someone were still interested, below is the implementation of Jeff's description
<#assign siteNetworks = []> <#list activities as activity> <#if activity.siteNetwork??> <#if !siteNetworks?seq_contains(activity.siteNetwork)> <#assign siteNetworks = siteNetworks + [activity.siteNetwork]> </#if> </#if> </#list> <#list siteNetworks as siteNetwork> <div style="..."> ${(siteTitles[siteNetwork]?html)!siteNetwork?html} </div> <#list activities as activity> <#if siteNetwork == activity.siteNetwork> ... </#if> </#list> </#list>
09-18-2018 01:12 PM
Hi, Jeff.
Thank you. Yes, I am aware of the template file. I needed some kind of comfirmation that this is correct way to do it. Alternatively, I was wondering if there is a common way to override Activity Feed Notification logic that creates objects for the FTL to avoid juggling with data in the template file.
But It would probably take less effort to modify just the presentation layer.
Best regards,
D.
09-18-2018 06:51 PM
Oh yeah, I'd definitely just do this in the presentation layer. Much easier and I know it works.
Explore our Alfresco products with the links below. Use labels to filter content by product module.