Detect if contact is a member of specific contact group using macros

   —   
In a K# you can check if a given contact is a member of a specific contact group, there is already a method for this purpose which isn't documented anywhere, so you can simply use the following method:

Siteobjects.Contacts.Where("ContactEmail='email@xyz.com'")[0].IsInContactGroup

So you can end up with macro like this:

{ % Siteobjects.Contacts.Where("ContactEmail='email@domain.com'")[0].ContactGroups.CodeNames["Unsubscribed"]!=null# % }
Share this article on   LinkedIn

Martin Danko

Let me guide you on your journey of success. I will show you how to optimize your content production with Kentico Draft. Check out www.kenticocloud.com