1 package FS::part_event::Action::notice_to;
4 use base qw( FS::part_event::Action );
5 use FS::Record qw( qsearchs );
8 sub description { 'Email a notice to a specific address'; }
10 sub eventtable_hashref {
16 'cust_pay_batch' => 1,
17 'cust_statement' => 1,
24 'to' => { 'label' => 'Destination',
28 'msgnum' => { 'label' => 'Template',
29 'type' => 'select-table',
30 'table' => 'msg_template',
31 'name_col' => 'msgname',
32 'hashref' => { disabled => '' },
38 sub default_weight { 56; } #?
41 my( $self, $object ) = @_;
43 my $cust_main = $self->cust_main($object);
45 my $msgnum = $self->option('msgnum');
47 my $msg_template = qsearchs('msg_template', { 'msgnum' => $msgnum } )
48 or die "Template $msgnum not found";
50 my $to = $self->option('to')
51 or die "Can't send notice without a destination address";
55 'cust_main' => $cust_main,