Message Template Files

libPRepS provides the PRepS databases with the capability of creating and sending e-mail messages upon specific events. PRepS databases can send e-mail when new problem reports are entered, when existing problem reports are (re)assigned, and when there is an update to the status of an existing problem report. Which messages get sent, and to whom is configured at the project level. However, the content of messages is configured at the system level. The files described here, the message template files, determine the content of the messages.

The message template files are stored in $(prefix)/share/libpreps. These files contain a template of the message to be sent. The template can contain plain text as well as message tags that are replaced by actual data when the message is sent.

Message Tags

Message tags are pre-defined tags in the template messages that are replaced with the appropriate problem report information before the message is sent to the recipients. A message tag is simply a key word surrounded by angle brackets (< and >). Several message tags are defined. However, at the time these routines were first designed, there was a hard coded limitation in PostgreSQL regarding the number of parameters that can be passed to a stored procedure. For this reason, not all tags can be used in all message templates. Refer to the documentation for each message template file to determine which tags are allowed.

NoteNote
 

Now that there is no longer such a restrictive limit in PostgreSQL on the number of parameters that can be passed to a stored procedure, I could modify libPRepS so that all message tags could be used in the each template file. However, the current design results in only tags that really make sense in a particular template file being allowed. Therefore, updating libPRepS to remove these restrictions is not very high on my TODO list.

There are 10 defined message tags:

<descr>

The description of the problem report. This tag is usable in all three message templates.

<fix>

The fix description of the problem report. This tag is usable in the assign and update message templates.

<num>

The problem report number. This tag is not currently usable.

<prj>

The name of the project. This tag is usable in the new problem report message template.

<pr_type>

The type of the problem report. This tag is usable in the new problem report message template.

<resp>

The name of the person the problem report is assigned to. This tag is usable in the assign and update message templates.

<sevr>

The severity of the problem report. This tag is usable in all three message templates.

<stat>

The status of the problem report. This tag is usable in the assign and update message templates.

<submitter>

The name of the person who submitted the problem report. This tag is usable in all three message templates.

<title>

The title (subject) of the problem report. This tag is usable in all three message templates.