3 Each template is split into two sections. A block of headers and a body. These
4 sections are separated by a blank line.
6 Templates are processed by the L<Text::Template> module. This module
7 allows you to embed arbitrary Perl code into your templates. Text wrapped
8 in curly braces, C<{...}> is interpreted as Perl. See L<Text::Template>
13 Your template may specify arbitrary email headers. Each header is a name, a
14 colon, then a value. So, for example, to specify a subject, you can use:
16 Subject: Thanks for your bug report.
18 =head3 Special Headers
22 =item Content-Type: text/html
24 The special header "Content-Type: text/html" tells RT that the template should
25 be parsed as HTML. RT will automatically make the outgoing message multipart.
26 That way, recipients who can read only plaintext email will receive something
27 readable, while users with clients which can display HTML will receive the full
28 experience. Please be aware that HTML support in mail clients varies greatly,
29 much more so than different web browsers.
31 We welcome contributions of HTML-ization of builtin templates.
37 Templates have a Type which dictates which level of code execution is
40 Templates of type C<Perl> are evaluated using L<Text::Template>
41 which allows arbitrary code execution. Only users which have the global
42 C<ExecuteCode> privilege may write templates of type C<Perl>. Prior to
43 RT 4.0, this was the only type of Template available.
45 Templates of type C<Simple> permit only simple variable interpolation.
46 No special privilege beyond C<ModifyTemplate> is needed to write C<Simple>
49 For both types of templates, text between curly braces C<{ ... }> is
50 interpolated. For C<Perl> templates, this text can be any code (see
51 L<Text::Template/Details>). For C<Simple> templates, only simple variables
52 are permitted; for example C<{ $TicketSubject }>.
58 The variables that your templates may use include:
64 The transaction object.
68 The value of the "rtname" config variable.
72 The ticket object. This is only set during a ticket transaction.
76 This is not an object, but the name of the first requestor on the ticket.
77 If this is not what you need, inspect C<< $Ticket->Requestors >>.
81 A localization function. See L<Locale::Maketext>.
85 =head3 Selected Simple template variables
87 Since method calls are not allowed in simple templates, many common
88 method results have been placed into scalar variables for the template's
99 =item $TicketQueueName
101 =item $TicketOwnerName
103 =item $TicketOwnerEmailAddress
105 =item $TicketCF(Name)
107 For example, C<$TicketCFDepartment>.
109 =item $TransactionType
111 =item $TransactionField
113 =item $TransactionOldValue
115 =item $TransactionNewValue
117 =item $TransactionData
119 =item $TransactionContent
121 =item $TransactionDescription
123 =item $TransactionBriefDescription
125 =item $TransactionCF(Name)
127 For example, C<$TransactionCFLocation>.