Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Summary

You may have Custom Satisfaction Surveys enabled but you may want to not show the survey for some specific recipients. What you can do is create a custom version of the “renderCustomerSatisfaction” that will only render if the recipient does not match a static list of Email Address.

Implementation

Note: If using a default theme then you would need to press Show System Defaults in the Themes tab.

To achieve this you will need to access the relevant Theme within Notifications > Themes and extract the “renderCustomerSatisfaction” macro and paste this within Notifications > Custom Macros and then add a condition to the beginning of the macro that will check if the recipient can be found within a static variable.

Once this is implemented it will then be used by all Templates including the Default JEMH templates.

Example Custom Macro

The below example will check if the recipient email address is within the blockedRecipients variable if so then the Custom Satisfaction will not be shown.

#macro(renderCustomerSatisfaction)
    #set ($blockedRecipients = "userX@test.com, userZ@test.com") ##Email addresses to not show for.
    #set ($currentRecipient = $jemhUtils.getUserEmailAddress($jemhUtils.getUser())) ##Gets the Address of the current recipient
    
    #if (!$blockedRecipients.contains($currentRecipient)) ##Checks if the Recipient address can be found within the blockedRecipients variable, if not the following will run
        #if ($jemhCustomerSatisfactionManager.shouldShowCustomerSatisfactionQuestion($context))
            $jemhUtils.setFieldRendered()
        <tr>
            <td class="email-content-main mobile-expand ">
                <table id="actions-pattern">
                    <tr>
                        <td id="actions-pattern-container">
                            <div class="jira-customer-satisfaction">
                                <div class="jira-customer-satisfaction-question">
                                    $messageUtils.getMessage("jira.email.customer.satisfaction.question")
                                </div>
                                <div class="jira-srf-line-break">
                                </div>
                                <table class="jira-srf-star-table-with-text" width="400">
                                    <tbody>
                                    <tr>
                                        #foreach($i in [$jemhCustomerSatisfactionManager.minRating .. $jemhCustomerSatisfactionManager.maxRating])
                                            <td class="jira-srf-star-with-text" width="75">
                                                <a href="$jemhCustomerSatisfactionManager.createLink($i)" class="jira-srf-star" target="_blank">☆</a>
                                                <p class="jira-srf-star-text">$messageUtils.getMessage("jira.email.customer.satisfaction.$i")</p>
                                            </td>
                                        #end
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        #end
    #end
#end
  • No labels