StringBuilder html = new StringBuilder();
html.append("<head>");
html.append(readStyle());
+ html.append(readViewTicketAction(ticket));
html.append("</head>");
html.append("<body>");
html.append(MarkdownUtils.transformGFM(settings, markdown, ticket.repository));
// respect the author's email preference
UserModel lastAuthor = userManager.getUserModel(lastChange.author);
- if (!lastAuthor.getPreferences().isEmailMeOnMyTicketChanges()) {
+ if (lastAuthor != null && !lastAuthor.getPreferences().isEmailMeOnMyTicketChanges()) {
toAddresses.remove(lastAuthor.emailAddress);
ccAddresses.remove(lastAuthor.emailAddress);
}
return sb.toString();
}
+ protected String readViewTicketAction(TicketModel ticket) {
+ String action = readResource("viewTicket.html");
+ action = action.replace("${url}", ticketService.getTicketUrl(ticket));
+ return action;
+ }
+
protected String readResource(String resource) {
StringBuilder sb = new StringBuilder();
InputStream is = null;
--- /dev/null
+<script type="application/ld+json">
+{
+ "@context": "http://schema.org",
+ "@type": "EmailMessage",
+ "description": "View this Ticket in Gitblit",
+ "action": {
+ "@type": "ViewAction",
+ "url": "${url}",
+ "name": "View Ticket"
+ }
+}
+</script>