broadband_nas export, #15284
[freeside.git] / rt / docs / templates.pod
1 =head1 Templates
2
3 Each template is split into two sections. A block of headers and a body. These
4 sections are separated by a blank line.
5
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>
9 for more information.
10
11 =head2 Headers
12
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:
15
16     Subject: Thanks for your bug report.
17
18 =head3 Special Headers
19
20 =over
21
22 =item Content-Type: text/html
23
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.
30
31 We welcome contributions of HTML-ization of builtin templates.
32
33 =back
34
35 =head2 Variables
36
37 The variables that your templates may use include:
38
39 =over 4
40
41 =item C<$Transaction>
42
43 The transaction object.
44
45 =item C<$rtname>
46
47 The value of the "rtname" config variable.
48
49 =item C<$Ticket>
50
51 The ticket object. This is only set during a ticket transaction.
52
53 =item C<$Requestor>
54
55 This is not an object, but the name of the first requestor on the ticket.
56 If this is not what you need, inspect C<< $Ticket->Requestors >>.
57
58 =item C<loc("text")>
59
60 A localization function. See L<Locale::Maketext>.
61
62 =back
63
64 =cut
65