At the time of rendering the webpopup, in order to replace the string '##campaignId##' with the correct one, we have
html = html.replace('##campaignId##', campaignId)
This works well for the existing web templates where we just have 1 occurrence of the string '##campaignId##' linked to the close button.
For the user ratings template, where we have 2 occurrences of the string '##campaignId##' (one in handler for close button and another in the onclick handler of submit button), only the 1st occurrence is getting replaced.
Resolution
Changed the logic to
html = html.replace(/##campaignId##/g, campaignId)
UT has been done to ensure that both the occurrences of the string '##campaignId##' in the User Ratings template are getting replaced correctly.
Analysis
At the time of rendering the webpopup, in order to replace the string '##campaignId##' with the correct one, we have
html = html.replace('##campaignId##', campaignId)
This works well for the existing web templates where we just have 1 occurrence of the string '##campaignId##' linked to the close button.
For the user ratings template, where we have 2 occurrences of the string '##campaignId##' (one in handler for close button and another in the onclick handler of submit button), only the 1st occurrence is getting replaced.
Resolution
Changed the logic to
html = html.replace(/##campaignId##/g, campaignId)
UT has been done to ensure that both the occurrences of the string '##campaignId##' in the User Ratings template are getting replaced correctly.