How to generate acknowledgements for create and comment to the sender only

Scenario

By default, JEMHC's email notification notifies users showing the issue information, this could be too much information for your regular customer. You may like to send a simple acknowledgement to your remote user in response to an email that created or commented issue through JEMHCloud. This page will show you how to create simple acknowledgements in each scenario.

Simple acknowledgement to the creator of an issue via email (Issue Created Event/Template Set)

In order to send a simple response to a user who has created an email, you need to create a custom template. We will base this example on the JIRA Theme. 

  1. Go to Notifications → Template Set → Create  and set a name (Simple ACK Issue Created) select JIRA theme, Issue Created template set and copy from the Issue Create default.

  2. Change the HTML body template. The full script is below in this document. Note: #if($jemhUtils.isIssueCreatedByRecipientViaEmail($context)) does the trick to change the template if the recipient is the creator of the issue.

  3. Update the Email Notification Mapping setting the new Template Set (Simple ACK Issue Created) in Issue Create Template Set

  4. Verify with a Test Case that the Issue Create via Email → ACK notification to the creator works


    After running the test case, the issue should have been created. You can see the Issue Created event in Auditing→Events


    Once the event is processed the ACK email should be sent. The creator of the issue (fboucquez@gmail.com) will receive the special simple Acknowledgements Notification 






Simple ACK Template Issue Created Body
#@issueNotification() <table id="background-table" cellpadding="0" cellspacing="0" width="100%"> <!-- header here --> #jemhIncludeStandardActionHeader() <tr> <td id="email-content-container"> <table id="email-content-table" cellspacing="0" cellpadding="0" border="0" width="100%"> #jemhIncludeIssueHeader() #if($jemhUtils.isIssueCreatedByRecipientViaEmail($context)) ## THIS IF DETECTS IF THE NOTIFICATION'S RECIPIENT IS THE USER THAT CREATED THE ISSUE.** <tr> <td class="email-content-main mobile-expand wrapper-special-margin"> $jemhUtils.setCommentRendered() Thank you for your email. We will be back to you soon! </td> </tr> #else #jemhIncludeIssueDetail($serviceJiraFields) #jemhIncludeDirectiveSetLinks() #jemhIncludeBody() #end #jemhIncludeAddComment() #jemhIncludeFooter() </table> </td> </tr> </table> #end #inhibitSendingConditions() 

Simple acknowledgement to the creator of  comment via email (Issue Updated Event/Template Set)

By default, JEMHC email notification mappings does not send an email to a user that has commented an issue via email. If you would like to send a simple ACK to the user, follow these steps.

  1. Go to Notifications → Template Set → Create  and set a name (Simple ACK Issue Updated) select JIRA theme, Issue Updated template set and copy from the Issue Create default

  2. Change the HTML body with the velocity script found below in this document. Note: #if($jemhUtils.isThereACommentCreatedByRecipientViaEmail($context)) does the trick to change the template if the recipient is the comment of the issue.

  3. Update the Email Notification Mapping setting up the new Issue Updated template (Simple ACK Issue Created). 

  4. Check Notify Users Of Their Actions When Update box

  5. Verify with a Test Case that the Issue Comment via Email → ACK notification to the sender works


    After running the test case, the issue should have been commented. You can see the Issue Updated event in Auditing→Events


    Once the event is processed the ACK email should be sent. The creator of the comment (fboucquez@gmail.com) will receive the special simple Acknowledgements Notification 



Simple ACK Template Issue Updated Body
#@issueNotification() <table id="background-table" cellpadding="0" cellspacing="0" width="100%"> <!-- header here --> #jemhIncludeStandardActionHeader() <tr> <td id="email-content-container"> <table id="email-content-table" cellspacing="0" cellpadding="0" border="0" width="100%"> #jemhIncludeIssueHeader() #if($jemhUtils.isThereACommentCreatedByRecipientViaEmail($context)) <tr> <td class="email-content-main mobile-expand wrapper-special-margin"> $jemhUtils.setCommentRendered() Thank you for your email. We will be back to you soon! </td> </tr> #else <tr> <td class="email-content-main mobile-expand wrapper-special-margin"> <table class="keyvalue-table"> #jemhIncludeChangeLog() </table> </td> </tr> #jemhIncludeBody() #end #jemhIncludeDirectiveSetLinks() #jemhIncludeAddComment() #jemhIncludeFooter() </table> </td> </tr> </table> #end #inhibitSendingConditions()



You could use $jemhUtils.setInhibitSending(true) in el #else condition in the templates if you just want to notify the sender with the thank you message.

Related articles