summaryrefslogtreecommitdiff
path: root/httemplate/elements/email-link.html
blob: 012afff1ae384e9a1adf6ab28e3c0c7bfbdd432c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
% if ( $FS::CurrentUser::CurrentUser->access_right('Bulk send customer notices') ) {
<A HREF="<%$p%>misc/email-customers.html?<%$query%>"><%$label%></A>
% }
<%init>
my %opt = @_;
my $search_hash = $opt{'search_hash'};
die "'table' required" if !$opt{'table'};
die "'search_hash' required" if !$search_hash;

my $uri = new URI;
my @params = map { $_, $search_hash->{$_} } sort keys %$search_hash;
$uri->query_form( @params,
                  table               => $opt{'table'},
                  agent_virt_agentnum => $opt{'agent_virt_agentnum'}
                );
my $query = $m->scomp('/elements/create_uri_query', query=>$uri->query);
my $label = ($opt{'label'} || 'Email a notice to these customers');
</%init>