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 {
19 'to' => { 'label' => 'Destination',
23 'msgnum' => { 'label' => 'Template',
24 'type' => 'select-table',
25 'table' => 'msg_template',
26 'name_col' => 'msgname',
27 'hashref' => { disabled => '' },
33 sub default_weight { 56; } #?
36 my( $self, $object ) = @_;
38 my $cust_main = $self->cust_main($object);
40 my $msgnum = $self->option('msgnum');
42 my $msg_template = qsearchs('msg_template', { 'msgnum' => $msgnum } )
43 or die "Template $msgnum not found";
45 my $to = $self->option('to')
46 or die "Can't send notice without a destination address";
50 'cust_main' => $cust_main,