blob: 126965374473f6e969693214510831bc24f1be7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
package FS::part_event::Action::notice;
use strict;
use base qw( FS::part_event::Action );
use FS::Record qw( qsearchs );
use FS::msg_template;
sub description { 'Send a notice from a message template'; }
#sub eventtable_hashref {
# { 'cust_main' => 1,
# 'cust_bill' => 1,
# 'cust_pkg' => 1,
# };
#}
sub option_fields {
(
'msgnum' => { 'label' => 'Template',
'type' => 'select-table',
'table' => 'msg_template',
'name_col' => 'msgname',
'disable_empty' => 1,
},
);
}
sub default_weight { 55; } #?
sub do_action {
my( $self, $object ) = @_;
my $cust_main = $self->cust_main($object);
my $msgnum = $self->option('msgnum');
my $msg_template = qsearchs('msg_template', { 'msgnum' => $msgnum } )
or die "Template $msgnum not found";
$msg_template->send(
'cust_main' => $cust_main,
'object' => $object,
);
}
1;
|