How to create HTML mail template ?

Intro

You can design HTML mails for the issue tracker. The mails will contain both (plain text and html) contents. This is necessary in the event a receiver does not accept HTML mails.

All HTML mail-templates to be stored into the plugins mailtemplate folder. The file names are to be used as shown in the table below.

TemplateUse case
cmnt_mod_mail.html This template is used when a comment was modified.
new_issue_mail.html This template is used when a new Issue was reported.
edit_issuemod_mail.html This template is used when an issue is modified on the issue list.
issue_descr_mail.html This template is used when a description of an issue was modified.
assignee_mail.html This template is used when somebody was assigned to an issue.
issue_resolved_mail.html This template is used when the issue status turning into resolved.

Place-holders

You can define the content beside the layout of an HTML mail. Therefore several place-holders are provided. The plugin will replace them with the proper values and/or localized strings. Not all place-holders can be used everywhere. That depends on the use case when a notification will be sent by mail. For instance, if there is a modification of the issue within the Issue List then no comment information will be available.

The capital letters used where values from the issues or comments are used, where small letters show you the reference to defined strings of the language file. This is just for your understanding. The plugin itself does not check place-holder in a case sensitive manner. You may write everything small if you want.

The following place-holders are defined:

Place-holderDescriptionExample
General Place-holders used everywhere
%%_SEE%% replaced by the link to the Issue Details http://www.fristercons.de/fcon/doku.php?id=issuetracker:report&do=showcaselink&showid=124&project=fcon_project
%%issuemod_head%% replaced by the related string of language file Dear user,
%%issuemod_issueid%% replaced by the related string of language file ID:
%%ID%% replaced by the Issue ID 124
%%issuemod_title%% replaced by the related string of language file Title:
%%TITEL%% replaced by the title of the issue option to allow unregistered users to create new tickets
%%issuemod_status%% replaced by the related string of language file Status:
%%STATUS%% replaced by the current status text of the issue new
%%th_project%% replaced by the related string of language file Project
%%PROJECT%% replaced by the project setting of the issue tracker fcon_project
%%issuemod_product%% replaced by the related string of language file Product:
%%PRODUCT%% replaced by the selected product Issue Tracker
%%issuemod_version%% replaced by the related string of language file Version:
%%VERSION%% replaced by the given version info 2012-09
%%issuemod_severity%% replaced by the related string of language file Severity:
%%SEVERITY%% replaced by the current severity text of this issue Feature Request
%%issuemod_creator%% replaced by the related string of language file Creator:
%%CREATOR%% replaced by the reporter of this issue Taggic
%%th_assigned%% replaced by the related string of language file Assigned to
%%ASSIGNED%% replaced by the currently assigned resource to this issue Taggic
%%th_created%% replaced by the related string of language file Created
%%CREATED%% replaced by the time-stamp where this issue was reported Feature Request
Place-holders used by resolving an issue
%%issue_resolved_intro%% replaced by the related string of language file Your reported issue was resolved.
%%issue_resolved_text%% replaced by the related string of language file Solution:
%%RESOLUTION%% replaced by the formatted resolution text of this issue 2012-10-31
%%TIMESTAMP%% replaced by the time-stamp of the modification 2012-09-20 16:24:49
%%RESOLVER%% replaced by user name, which turned the issue status into resolve Taggic
%%MOD_BY%% replaced by user name, who modified the issue Taggic
%%issuedescrmod_subject%% The mail subject replaced by the related string of language file in combination with issue values (ID, Project) Issue #%s on %s: initial description modified
%%th_description%% replaced by the related string of language file Description
%%DESCRIPTION%% replaced by the formatted issue description … I would like to allow unregistered users to report issues in IssueTracker.
I unchecked “plugin»issuetracker»registered_users” in config, but it does …
%%issuemod_br%% replaced by the related string of language file best regards
%%issuemod_end%% replaced by the related string of language file Issue Tracker
Place-holders used by comment modification
%%lbl_cmts_wlog%% replaced by the related string of language file Comments (work log)
%%CMNT_ID%% replaced by the ID of the related comment [1]
%%CMNT_AUTHOR%% replaced by the author of the related comment Taggic
%%CMNT_TIMESTAMP%% replaced by the time-stamp when the comment was written 2012-09-20 16:24:49
%%COMMENT%% replaced by the formatted comment text a comment

HTML mail example

The following picture just illustrates a simple HTML mail output in the event a new issue was reported. All necessary information are given in HTML tables with a bit styling. There is a set of standard mail templates available for download at the end of this page.

The following code delivers a similar style as the picture above but is much easier to read. You may use this as a skeleton for your own design.

new_issue_mail.html
fcon Issue Tracker notification
%%ID%% %%TITEL%%
%%issuemod_issueid%% %%ID%%
%%th_project%% %%PROJECT%%
%%issuemod_product%% %%PRODUCT%%
%%issuemod_version%% %%VERSION%%
%%issuemod_severity%% %%SEVERITY%%
%%issuemod_status%% %%STATUS%%
%%issuemod_creator%% %%CREATOR%%
%%th_created%% %%CREATED%%
%%th_description%%
%%description%%
  1.  
  2.   <head>
  3.   <title>fcon Issue Tracker notification</title>
  4.   </head>
  5.   <body>
  6.     <div style="width: 780px;">
  7.     <div>
  8.         <table style="width: 100%;">
  9.           <tr>
  10.             <td colspan="6" style="vertical-align: middle;padding: 0;background-color: #CED2DB;margin: 0">
  11.               <span> %%ID%% </span>
  12.               <a href="%%_SEE%%">%%TITEL%%</a>
  13.             </td>
  14.           </tr>
  15.         </table>
  16.         <div style="padding: 0;margin: 0;clear: both;line-height: 0;height: 0;overflow: hidden"></div>
  17.         <table style="width: 100%;">
  18.           <tr>
  19.             <td style="width: 35%;">
  20.               <table style="width: 100%; border: solid 1px;border-bottom: solid 2px;border-right: solid 2px;
  21.                            border-color: #b0b0b0;background-color: #f0f0f0;padding: 0;margin: 0;
  22.                            font-family: Calibri;font-size: 9pt;border-radius: 0.25em;float: right">
  23.                 <tr> <td>%%issuemod_issueid%% </td>     <td>%%ID%%      </td>     </tr>
  24.                 <tr> <td>%%th_project%%       </td>     <td>%%PROJECT%% </td>     </tr>
  25.                 <tr> <td>%%issuemod_product%% </td>     <td>%%PRODUCT%% </td>     </tr>
  26.                 <tr> <td>%%issuemod_version%% </td>     <td>%%VERSION%% </td>     </tr>
  27.                 <tr> <td>%%issuemod_severity%%</td>     <td>%%SEVERITY%%</td>     </tr>
  28.                 <tr> <td>%%issuemod_status%%  </td>     <td>%%STATUS%%  </td>     </tr>
  29.                 <tr> <td>%%issuemod_creator%% </td>     <td><a href="mailto:%%CREATOR%%">%%CREATOR%%</a></td></tr>
  30.                 <tr> <td>%%th_created%%       </td>     <td>%%CREATED%% </td>     </tr>
  31.               </table>
  32.             </td>
  33.             <td style="width: 65%;vertical-align: text-top;">
  34.               <table style="width: 100%; border: 0;margin: 0;padding: 4px;font-family: Calibri;font-size: 10pt;">
  35.                 <tr>
  36.                   <td style="background-color: #CED2DB;border: 1px solid #99F;">%%th_description%%</td>
  37.                 </tr>
  38.                 <tr>
  39.                   <td style="border: solid 1px;">%%description%%</td>
  40.                 </tr>
  41.               </table>
  42.             </td></tr>
  43.         </table>
  44.        </div>
  45.     </div>
  46.     <div class="clearer" style="padding: 0;margin: 0;clear: both;line-height: 0;height: 0;overflow: hidden"></div>
  47.   </body>
  48. </html>
  49.  

Download

The following package is to be extracted into the mailtemplate folder of the plugin. It delivers the HTML mail templates as formerly used by fcon - IssueTracker.

Download: HTML mail templates

issuetracker/html-mail.txt · Last modified: 2014/04/30 09:36 (external edit)

This Wiki is hosted and ruled by Policies of Frister Consultancy Services.
By using this wiki you accept these rules. -> Impressum