X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fmsg_template.pm;h=50a9b3f27665a653829b47dc7b5a0266cdc47645;hp=70e5569249e195d33e27ed9550275723fddf831c;hb=755159a8654a2eda89badd1498f8def3a472cb15;hpb=bd714630f4747b3f411ae53515a734e9e771c6b3 diff --git a/FS/FS/msg_template.pm b/FS/FS/msg_template.pm index 70e556924..50a9b3f27 100644 --- a/FS/FS/msg_template.pm +++ b/FS/FS/msg_template.pm @@ -383,12 +383,26 @@ sub prepare { my @to; if ( exists($opt{'to'}) ) { + @to = split(/\s*,\s*/, $opt{'to'}); + + } elsif ( $cust_main ) { + + my @classes; + if ( $opt{'to_contact_classnum'} ) { + my $classnum = $opt{'to_contact_classnum'}; + @classes = ref($classnum) ? @$classnum : split(',', $classnum); + } + if (!@classes) { + @classes = ( 'invoice' ); + } + @to = $cust_main->contact_list_email(@classes); + + } else { + + die 'no To: address or cust_main object specified'; + } - else { - @to = $cust_main->invoicing_list_emailonly; - } - # no warning when preparing with no destination my $from_addr = $self->from_addr;