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',
21 'hashref' => { disabled => '' },
27 sub default_weight { 56; } #?
30 my( $self, $svc_acct ) = @_;
32 my $cust_main = $self->cust_main($svc_acct)
33 or die "No customer found for svcnum ".$svc_acct->svcnum;
34 # this will never be run for unlinked services, for several reasons
36 my $msgnum = $self->option('msgnum');
38 my $msg_template = qsearchs('msg_template', { 'msgnum' => $msgnum } )
39 or die "Template $msgnum not found";
41 my $email = $svc_acct->email
42 or die "No email associated with svcnum ".$svc_acct->svcnum;
45 'cust_main' => $cust_main,
46 'object' => $svc_acct,