stray closing /TABLE in the no-ticket case
[freeside.git] / httemplate / elements / email-link.html
1 % if ( $FS::CurrentUser::CurrentUser->access_right('Bulk send customer notices') ) {
2 <A HREF="<%$p%>misc/email-customers.html?table=<%$table%>&agent_virt_agentnum=<%$agent_virt_agentnum%>&<%$query%>"><%$label%></A>
3 % }
4 <%init>
5 my %opt = @_;
6 my $table = $opt{'table'};
7 my $agent_virt_agentnum = $opt{'agent_virt_agentnum'};
8 my $search_hash = $opt{'search_hash'};
9 die "'table' required" if !$table;
10 die "'search_hash' required" if !$search_hash;
11
12 my $uri = new URI;
13 my @params = map { $_, $search_hash->{$_} } sort keys %$search_hash;
14 $uri->query_form(@params);
15 my $query = $uri->query;
16 my $label = ($opt{'label'} || 'Email a notice to these customers');
17 </%init>
18