E-Mail-Versand: vorbelegter Text für Rechnungen mit aktiviertem Bankeinzug
[kivitendo-erp.git] / SL / Form.pm
index 3da4e62..be88b28 100644 (file)
@@ -1372,8 +1372,11 @@ sub generate_email_body {
 
   return undef unless $body;
 
-  $body   .= GenericTranslations->get(translation_type =>"salutation_punctuation_mark", language_id => $self->{language_id}) . "\n";
-  $body   .= GenericTranslations->get(translation_type =>"preset_text_$self->{formname}", language_id => $self->{language_id});
+  my $translation_type = $params{translation_type} // "preset_text_$self->{formname}";
+  my $main_body        = GenericTranslations->get(translation_type => $translation_type,                  language_id => $self->{language_id});
+  $main_body           = GenericTranslations->get(translation_type => $params{fallback_translation_type}, language_id => $self->{language_id}) if !$main_body && $params{fallback_translation_type};
+  $body               .= GenericTranslations->get(translation_type => "salutation_punctuation_mark",      language_id => $self->{language_id}) . "\n\n";
+  $body               .= $main_body;
 
   $body = $main::locale->unquote_special_chars('HTML', $body);