X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fmisc%2Femail-customers.html;h=6e37d74fc756ed08650e169a0361e54efe830087;hb=c883d44a1e9a48505ba2427cf17d39595c38092c;hp=c9a216c3ab9a86824cdd7c4c0ffe09dc29de914d;hpb=bb64a357a453b06e0079444ce21c7e85d9c1527d;p=freeside.git diff --git a/httemplate/misc/email-customers.html b/httemplate/misc/email-customers.html index c9a216c3a..6e37d74fc 100644 --- a/httemplate/misc/email-customers.html +++ b/httemplate/misc/email-customers.html @@ -46,6 +46,8 @@ should be used to set msgnum or from/subject/html_body cgi params + + % if ( $cgi->param('action') eq 'send' ) { @@ -55,13 +57,12 @@ should be used to set msgnum or from/subject/html_body cgi params <& /elements/progress-init.html, 'OneTrueForm', [ qw( search table from subject html_body text_body - msgnum to_contact_classnum ) ], + msgnum to_contact_classnum emailtovoice_contact custnum ) ], $process_url, $pdest, &> % } elsif ( $cgi->param('action') eq 'preview' ) { - Preview notice @@ -151,7 +152,11 @@ Template: &>
% # select destination contact classes -Send to contacts: + + + + + +
Send to contacts: +
<& /elements/checkboxes.html, 'style' => 'display: inline; vertical-align: top', 'disable_links' => 1, @@ -162,6 +167,24 @@ Send to contacts: $name eq 'invoice' #others default to unchecked }, &> +
+% if ($send_to_domain) { +
+ Email to voice +
+ +% } +

% # if sending a one-off message, show a form to edit it @@ -199,6 +222,7 @@ Send to contacts: %#Substitution vars: + % } #end not action or alternate form @@ -211,6 +235,18 @@ Send to contacts: % } + + <& /elements/footer.html &> <%init> @@ -219,17 +255,23 @@ my %opt = @_; $opt{'acl'} ||= 'Bulk send customer notices'; +my $email_to; + die "access denied" unless $FS::CurrentUser::CurrentUser->access_right($opt{'acl'}); my $conf = FS::Conf->new; my @no_search_fields = qw( action table from subject html_body text_body popup url ); +my $send_to_domain = $conf->config('send-to-domain'); + my $form_action = $opt{'form_action'} || 'email-customers.html'; my $process_url = $opt{'process_url'} || 'process/email-customers.html'; my $title = $opt{'title'} || 'Send customer notices'; push( @no_search_fields, @{$opt{'no_search_fields'}} ) if $opt{'no_search_fields'}; +$m->comp('/elements/handle_uri_query'); + my $table = $cgi->param('table') or die "'table' required"; my $agent_virt_agentnum = $cgi->param('agent_virt_agentnum') || ''; @@ -308,6 +350,11 @@ if ( $cgi->param('action') eq 'preview' ) { # contact_class_X params in preview foreach my $param ( $cgi->param ) { + if ($cgi->param('emailtovoice_contact')) { + $email_to = $cgi->param('emailtovoice_contact') . '@' . $send_to_domain; + push @contact_classnum, 'emailtovoice'; + push @contact_classname, $email_to; + } if ( $param =~ /^contact_class_(\w+)$/ ) { push @contact_classnum, $1; if ( $1 eq 'invoice' ) { @@ -325,10 +372,12 @@ if ( $cgi->param('action') eq 'preview' ) { my @contact_checkboxes = ( [ 'invoice' => { label => 'Invoice recipients' } ] ); + foreach my $class (qsearch('contact_class', { disabled => '' })) { push @contact_checkboxes, [ $class->classnum, { label => $class->classname } ]; } +