1 package FS::part_event::Action::svc_acct_notice;
4 use base qw( FS::part_event::Action );
5 use FS::Record qw( qsearchs );
9 sub description { 'Email a notice to this account'; }
11 sub eventtable_hashref {
17 'msgnum' => { 'label' => 'Template',
18 'type' => 'select-table',
19 'table' => 'msg_template',
20 'name_col' => 'msgname',
26 sub default_weight { 56; } #?
29 my( $self, $svc_acct ) = @_;
31 my $cust_main = $self->cust_main($svc_acct)
32 or die "No customer found for svcnum ".$svc_acct->svcnum;
33 # this will never be run for unlinked services, for several reasons
35 my $msgnum = $self->option('msgnum');
37 my $msg_template = qsearchs('msg_template', { 'msgnum' => $msgnum } )
38 or die "Template $msgnum not found";
40 my $email = $svc_acct->email
41 or die "No email associated with svcnum ".$svc_acct->svcnum;
44 'cust_main' => $cust_main,
45 'object' => $svc_acct,