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',
27 'validation' => 'ut_email',
29 'msgnum' => { 'label' => 'Template',
30 'type' => 'select-table',
31 'table' => 'msg_template',
32 'name_col' => 'msgname',
33 'hashref' => { disabled => '' },
39 sub default_weight { 56; } #?
42 my( $self, $object ) = @_;
44 my $cust_main = $self->cust_main($object);
46 my $msgnum = $self->option('msgnum');
48 my $msg_template = qsearchs('msg_template', { 'msgnum' => $msgnum } )
49 or die "Template $msgnum not found";
51 my $to = $self->option('to')
52 or die "Can't send notice without a destination address";
56 'cust_main' => $cust_main,