1 package FS::part_event::Action::cust_bill_send_with_notice;
4 use base qw( FS::part_event::Action );
8 sub description { 'Email a notice to the customer with invoice attached'; }
10 sub eventtable_hashref {
16 'msgnum' => { label => 'Message template',
17 type => 'select-table',
18 table => 'msg_template',
19 hashref => { disabled => '' },
20 name_col => 'msgname',
23 'modenum' => { label => 'Invoice mode',
24 type => 'select-invoice_mode',
30 sub default_weight { 56; }
33 my( $self, $cust_bill, $cust_event ) = @_;
35 $cust_bill->set('mode' => $self->option('modenum'));
36 my %args = ( 'time' => $cust_event->_date );
37 my $mimepart = MIME::Entity->build( $cust_bill->mimebuild_pdf(\%args) );
38 my $msgnum = $self->option('msgnum');
39 my $msg_template = FS::msg_template->by_key($msgnum)
40 or die "can't find message template #$msgnum to send with invoice";
42 'cust_main' => $cust_bill->cust_main,
43 'object' => $cust_bill,