How to send notification based on site with groupid
How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
Legacy Article
You are viewing an article from our legacy "FastTrack"
publication program, made available for informational purposes. Articles
in this program were published without a requirement for independent
editing or verification and are provided"as is" without
guarantee.
Before using any information from this article, independently verify its
suitability for your situation and project.
Issue
- When having two separate sites, we want to create different notification for each, but we can't set separate notifications for different sites with the condition: groupId==<groupId of your site>.
If we create "A notification" for "A site" and "B notification" for "B site", the triggering on "B site" invokes both "A" and "B" notifications, even, when the site is specified with groupID in the notification's condition.
Resolution
- Since GroupID is not usable for such condition, as a workaround you should use a Groovy Script with ChannelID instead of GroupID.
- On this LPS, you can find a template Groovy Script to achieve such behavior.
Did this article resolve your issue ?