<!-- $Id: compose_mail.tt2 6395 2010-04-02 12:53:23Z david.verdin $ -->
<div class="block">

[% IF !subaction %]
	<h2>[%|loc%]Sending a message to the list[%END%] <a class="input" href="[% path_cgi %]/nomenu/help/sendmsg" title="[%|loc%]Open in a new window[%END%]" onclick="window.open('','wws_help','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=200')" target="wws_help">[%|loc%]Help[%END%]</a></h3>
	<br />
[% END %]

<form class="noborder" action="[% path_cgi %]" method="post" name="compose_mail">

[% IF subaction == "html_news_letter" %]
	<h2>[%|loc%]Sending an html page to the list [%END%] <a class="input" href="[% path_cgi %]/nomenu/help/sendmsg" title="[%|loc%]Open in a new window[%END%]" onclick="window.open('','wws_help','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=400,height=200')" target="wws_help">[%|loc%]Help[%END%]</a></h3>
   	<br />

[% END %]


    <fieldset>
	[%|loc(user.email)%]From: %1[%END%]<br />
	[%|loc(mailto)%]To: %1[%END%]<br />
	<label for="subject">[%|loc%]Subject:[%END%] <input id="subject" type="text" size="45" name="subject" value="[% subject %]" /></label>
	[% IF subaction == "html_news_letter" %]
		<input type="hidden" name="html_news_letter" value="[% subaction %]" />
	[% END %]
	<input type="hidden" name="action" value="send_mail"/>
		<input class="MainMenuLinks" type="submit" name="sub_action_sendmailtolist" value="[%|loc%]Send to selected receipient[%END%]" [%- IF topic_required -%] onclick="return checkbox_check_topic(compose_mail)" [% END %]/>
		<input class="MainMenuLinks" type="submit" name="sub_action_sendmailtome" value="[%|loc%]Send to me[%END%]" [%- IF topic_required -%] onclick="return checkbox_check_topic(compose_mail)" [% END %]/>
	<br />

	<input type="hidden" name="in_reply_to" value="[% in_reply_to %]" />
	<input type="hidden" name="message_id" value="[% message_id %]" />
	<input type="hidden" name="list" value="[% list %]" />	
	[% SET counter = 0 %]
	[% SET stringto = '' %]
	[% FOREACH r = recipients %]
    		[% IF counter == 0 %]
        		[% stringto = r.value.local_to _ ' ' _ r.value.domain_to %]
			[% counter = 1 %]
    		[% ELSE %]
        		[% stringto = stringto _ ',' _ r.value.local_to _ ' ' _ r.value.domain_to %]
    		[% END %]
	[% END %]
	<input type="hidden" name="to" value="[% stringto %]" />

 	[% IF request_topic %]
   		<br />
   		[%|loc%]This list is configured to require topic(s).[%END%]
   		<br />
   		[%|loc%]Please select one or more topic(s) that corresponds to your message:[%END%]
   		<br />
   		[% FOREACH t = available_topics %] 
     			<input type="checkbox" name="topic_[%t.name%]" value="1"/> [% t.title %]
     			<br />
   		[% END %]
   		<br />
 	[%  END %]

	[% IF !subaction %]
		[% balise_email = '['_'%'_' user.email '_'%'_']' %]
		[% balise_fingerprint = '['_'%'_' user.fingerprint '_'%'_']' %]
  		<textarea name="body" cols="80" rows="25"></textarea>
		<br />
		<br />
		<b>[%|loc%]Messages customization: use the template syntax:[%END%] <a href="http://www.tt2.org">TT2</a></b><br />
		[%|loc%]Below are some examples of TT2 parameters usable in messages.[%END%]<br/>
		<ul>
			<li> <b>[&#37; listname &#37;]</b>[%|loc%]: the listname; always available.[%END%]</li>
			<li> <b>[&#37; robot &#37;]</b>[%|loc%]: the name of the host the list is intalled on; always available.[%END%]</li>
			<li> <b>[&#37; user.email &#37;]</b>[%|loc%]: the user email; always available.[%END%]</li>
			<li> <b>[&#37; user.gecos &#37;]</b>[%|loc%]: the user name associated to her email; always available.[%END%]</li>
			<li> <b>[&#37; user.friendly_date &#37;]</b>[%|loc%]: the - human readable - user's subscription date; always available.[%END%]</li>
			<li> <b>[&#37; user.custom_attribute.title.value &#37;]</b>[%|loc%]: can be anything you like; available if you defined a user custom attribute named "title" (see the list configuration, section "Miscellaneous").[%END%]</li>
			<li> <b>[&#37; user.custom_attribute.name.value &#37;]</b>[%|loc%]: can be anything you like; available if you defined a user custom attribute named "name".[%END%]</li>
			<li> <b>[&#37; user.custom_attribute.organization.value &#37;]</b>[%|loc%]: can be anything you like; available if you defined a user custom attribute named "organization".[%END%]</li>
		</ul>
	[%  END %]
	[% IF subaction == "html_news_letter" %]
   		<label for="url">[%|loc%]URL:[%END%] <input id="url" type="text" size="45" name="url" value="[% url %]" /></label>	
	<br /><br />
	[%  END %]
    </fieldset>
</form>

</div>
<!-- end compose_mail.tt2 -->
