don't try to produce plain text quotations without a template, #34460, from #31786
authorMark Wells <mark@freeside.biz>
Fri, 17 Apr 2015 04:54:54 +0000 (21:54 -0700)
committerMark Wells <mark@freeside.biz>
Fri, 17 Apr 2015 04:54:54 +0000 (21:54 -0700)
FS/FS/Template_Mixin.pm

index c5a416b..9e43c3c 100644 (file)
@@ -2093,11 +2093,20 @@ sub generate_email {
 
   if (!@text) {
 
-    warn "$me generating plain text invoice"
-      if $DEBUG;
+    if ( $conf->config($tc.'template') ) {
+
+      warn "$me generating plain text invoice"
+        if $DEBUG;
 
-    # 'print_text' argument is no longer used
-    @text = $self->print_text(\%args);
+      # 'print_text' argument is no longer used
+      @text = $self->print_text(\%args);
+
+    } else {
+
+      warn "$me no plain text version exists; sending empty message body"
+        if $DEBUG;
+
+    }
 
   }