summaryrefslogtreecommitdiff
path: root/FS/FS/msg_template
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-09-18 10:18:43 -0700
committerMark Wells <mark@freeside.biz>2015-09-18 10:18:43 -0700
commitc0c5709fb022b83a482d0b35f7094505766d5868 (patch)
tree1cc652dad8a1280f4297c0ab12e8520e610fbd14 /FS/FS/msg_template
parent7bce756e86a4307d6cad49a690f22a321acc9981 (diff)
send commission reports by email, #33101
Diffstat (limited to 'FS/FS/msg_template')
-rw-r--r--FS/FS/msg_template/email.pm12
-rw-r--r--FS/FS/msg_template/http.pm4
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;