[% PROCESS elements.html; %]
<< [% text('Return') %]
[% text('Compose e-mail') %]
[% PROCESS input element_data = { name = "from" label = text("From") readonly = "readonly" type = "text" value = from }; %]
[% PROCESS input element_data = { name = "to" label = text("To") type = "text" value = to }; %]
[% PROCESS input element_data = { name = "cc" label = text("Cc") type = "text" value = cc }; %]
[% PROCESS input element_data = { name = "bcc" label = text("Bcc") type = "text" value = bcc }; %]
[% PROCESS input element_data = { name = "subject" label = text("Subject") type = "text" value = subject }; %]
[% PROCESS textarea element_data = { label = text("Body") name = "body" type = "text" value = body }; %]
[% PROCESS input element_data = { name = "notify" label = text("Read receipt") type = "checkbox" value = notify }; %]
[% FOR action IN actions ; NEXT IF action.value == 'attach'; PROCESS button element_data = { name = 'wf_action' text = maketext(action.text) value = action.value id = 'wf-action-' _ action.value }; END %]
[% IF attachments.size > 0 ; '

Attachments
Filename | Description
--- | ---
'; FOR att IN attachments ; %]
[% att.file_name %] | [% att.description %]
[% END ; # FOR '

'; END ; # IF have_attach = 0; FOR action IN actions ; have_attach = have_attach OR action.value == 'attach'; END ; IF have_attach ; %]
[% END ; # IF IF expansions.keys.size > 0 ; %]

[% text('The e-mail body may contain variables to be expanded - e.g. <%invnumber%> - the table below specifies the available variables and their expansions for this e-mail') %]

[% text('Variable') %] | [% text('Expansion') %]
--- | ---
[% FOR expansion_key IN expansions.keys ; %]
[% expansion_key %] | [% expansions.$expansion_key %]
[% END ; # FOR %]

[% END ; # IF %]