Hi there!
I am looking for a way to get the HTML content for an email that is usually sent out by Jira itself when an issue is created. I have tested this piece of code but unfortunely it does not correctly render:
private String renderEmail() {
ApplicationProperties ap = ComponentAccessor.getApplicationProperties();
String baseUrl = ap.getString(APKeys.JIRA_BASEURL);
MutableIssue issue = ComponentAccessor.getIssueManager().getIssueByCurrentKey("DEMO-1");
VelocityManager vm = ComponentAccessor.getVelocityManager();
Map<String, Object> context = issue.getIssueRenderContext().getParams();
String renderedText = vm.getBody("templates/email/html", "issuecreated.vm", baseUrl, context);
return renderedText;
}
Has any one an idea how to get the correct result?
Best regards,
Matthew :-)