Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

Info

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.

Code Block
#macro(renderCustomerSatisfaction)
    #set ($blockedRecipients = "userX@testuser1@example.com, userZ@testuser2@example.com") ##Email addresses to not show for.
    #set ($currentRecipient = $jemhUtils.getUserEmailAddress($jemhUtils.getUser())) ##Gets the Address of the current recipient
    
    #if ($$blockedRecipients!$blockedRecipients.contains($currentRecipient) && $jemhCustomerSatisfactionManager.shouldShowCustomerSatisfactionQuestion($context)) ##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