diff options
author | ivan <ivan> | 2010-07-13 11:10:31 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-07-13 11:10:31 +0000 |
commit | 99af479c12baf1f7da52e06841f0ac4f4832d766 (patch) | |
tree | e73a65542dd1208f9b32123d5ef62eea29270537 /FS/FS/part_event/Action/notice.pm | |
parent | f9a89c91cab9e85a7ca8dd67782919f8a85c2ebb (diff) |
notices, RT#8324
Diffstat (limited to 'FS/FS/part_event/Action/notice.pm')
-rw-r--r-- | FS/FS/part_event/Action/notice.pm | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/FS/FS/part_event/Action/notice.pm b/FS/FS/part_event/Action/notice.pm new file mode 100644 index 000000000..126965374 --- /dev/null +++ b/FS/FS/part_event/Action/notice.pm @@ -0,0 +1,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; |