Freemarker Data Model for Email Templates
Customizing Fisheye email templates with Freemarker
This page lists the Freemarker data-model for Fisheye email templates. See the Freemarker documentation for instructions on Freemarker syntax. Use the templates that ship with Fisheye as a guide to the properties available on each object.
These templates are used to send both batch (e.g. daily) and immediate emails. The template has access to the changesets variable which contains the list of changesets to send.
The default Fisheye email templates make use of various data model objects, listed below.
Here is a simple example that prints out each revision in each changeset.
[#list changesets as cs]
${cs.id}
Author: ${cs.author}
Comment: ${cs.comment}
Files:
[#list cs.revisionInfos as rev]
${rev.path} ${rev.revision}
[/#list]
[/#list]
Primary Data Model Objects
Object name |
機能 |
注意 |
---|---|---|
repname |
リポジトリの名前。 |
|
siteurl |
Base URL of the Fisheye instance |
|
タイムゾーン |
The time zone as configured in admin |
|
watchpath |
The path for this watch |
|
changesets |
A list of changesets |
|
The syntax to use the data model object 'repname' as an example, is as follows:
${repname}
Changeset objects
The changesets list will contain multiple changesets for batch (e.g. daily) notifications and one element for immediate notifications.
These changeset objects have the following properties:
Object name |
機能 |
注意 |
---|---|---|
comment |
The commit comment |
Belongs to a changeset |
author |
Author of the commit |
Belongs to a changeset |
dateValue |
the date of the commit |
Belongs to a changeset |
revisionInfos |
A list of revisions for the changeset |
Belongs to a changeset |
For example, to iterate through all the changesets notifications, you would use the following:
[#list changesets as cs]
${cs.id} ${cs.author}
[/#list]
Revision objects
Object name |
機能 |
注意 |
---|---|---|
path |
The path of the file |
Belongs to a revisionInfo, under a changeset |
revision |
The revision number |
Belongs to a revisionInfo, under a changeset |
binary |
Boolean indicating whether file is binary |
Belongs to a revisionInfo, under a changeset |
dead |
Boolean indicating whether file is deleted |
Belongs to a revisionInfo, under a changeset |
移動 |
Boolean indicating whether file is moved |
Belongs to a revisionInfo, under a changeset |
コピー |
Boolean indicating whether file is copied |
Belongs to a revisionInfo, under a changeset |
added |
Boolean indicating whether file is added |
Belongs to a revisionInfo, under a changeset |
linesAdded |
Number of lines added |
Belongs to a revisionInfo, under a changeset |
linesRemoved |
Number of lines removed |
Belongs to a revisionInfo, under a changeset |