diff options
Diffstat (limited to 'FS/FS/msg_template')
-rw-r--r-- | FS/FS/msg_template/email.pm | 12 | ||||
-rw-r--r-- | FS/FS/msg_template/http.pm | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/FS/FS/msg_template/email.pm b/FS/FS/msg_template/email.pm index e6d5a5a..377dbb1 100644 --- a/FS/FS/msg_template/email.pm +++ b/FS/FS/msg_template/email.pm @@ -200,6 +200,12 @@ A hash reference of additional substitutions A string identifying the kind of message this is. Currently can be "invoice", "receipt", "admin", or null. Expand this list as necessary. +=item override_content + +A string to use as the HTML body; if specified, replaces the entire +body of the message. This should be used ONLY by L<FS::report_batch> and may +go away in the future. + =back =cut @@ -265,6 +271,12 @@ sub prepare { warn "$me filling in body template\n" if $DEBUG; $body = $body_tmpl->fill_in( HASH => $hashref ); + # override $body if requested + if ( $opt{'override_content'} ) { + warn "$me overriding template body with requested content" if $DEBUG; + $body = $opt{'override_content'}; + } + ### # and email ### diff --git a/FS/FS/msg_template/http.pm b/FS/FS/msg_template/http.pm index 51dfcff..a2b0986 100644 --- a/FS/FS/msg_template/http.pm +++ b/FS/FS/msg_template/http.pm @@ -59,6 +59,10 @@ sub prepare { %$document, %$hashref }; + # put override content _somewhere_ so it can be used + if ( $opt{'override_content'} ) { + $document{'content'} = $opt{'override_content'}; + } my $request_content = $json->encode($document); warn "$me ".$self->prepare_url."\n" if $DEBUG; |