Use a template to set the contents of the MergedEmails.

Add an admin editable Merged.vm template used to format the
contents of the merged change emails.

Change-Id: I79823c2135383a7dbf7f245abea3d693db025150
This commit is contained in:
Martin Fick
2010-07-23 17:31:26 -06:00
parent b7f3b2d5be
commit 7305be4faf
5 changed files with 93 additions and 51 deletions

View File

@@ -252,21 +252,27 @@ public abstract class ChangeEmail extends OutgoingEmail {
/** Format the change message and the affected file list. */
protected void formatChangeDetail() {
appendText(getChangeDetail());
}
/** Create the change message and the affected file list. */
public String getChangeDetail() {
StringBuilder detail = new StringBuilder();
if (patchSetInfo != null) {
appendText(patchSetInfo.getMessage().trim());
appendText("\n");
detail.append(patchSetInfo.getMessage().trim() + "\n");
} else {
appendText(change.getSubject().trim());
appendText("\n");
detail.append(change.getSubject().trim() + "\n");
}
if (patchSet != null) {
appendText("---\n");
detail.append("---\n");
for (PatchListEntry p : getPatchList().getPatches()) {
appendText(p.getChangeType().getCode() + " " + p.getNewName() + "\n");
detail.append(p.getChangeType().getCode() + " " + p.getNewName() + "\n");
}
appendText("\n");
detail.append("\n");
}
return detail.toString();
}
/** Get the patch list corresponding to this patch set. */