scottvonduhn
10/07/2020, 8:00 PMnstranslation
module to retrieve localized strings in a template. However, it doesn’t seem to work at all in a regular email template. I am trying instead to use an advanced HTML template file, but I want to render it as HTML, not as a PDF, and I am trying to use renderer.renderAsString()
, but that just gives me the content of the template (including the pdf tags), but with all freemarker variables removed.
Is there a way to print an advanced template from a file to HTML, or is there a better way to send localized versions of emails than this approach? Thanks!michoel
10/08/2020, 12:58 AM<pdf>
with <html>
etc.scottvonduhn
10/08/2020, 12:48 PMscottvonduhn
10/08/2020, 12:49 PMrenderer.renderAsString()
is just this (the translation strings are not inserted):scottvonduhn
10/08/2020, 12:53 PMrenderer.renderAsPdf()
displays the translated content:
We’ve attached a copy of your current statement for your reference.
If you’ve already sent us your payment, thank you!
Wir helfen Ihnen gerne!
Vielen Dank
scottvonduhn
10/08/2020, 12:59 PMrenderAsString
doesn’t even change the pdf tags to html, so I get the feeling it’s not the right method to use. But, the only function I see that produces HTML output is renderer.renderToResponse({ response })
, but that requires a http.ServerResponse input parameter, and this is a server side script (Map/Reduce). Is there any way to produce HTML output directly in a server script?scottvonduhn
10/08/2020, 6:53 PMrenderer.renderToResponse
which feels like a hack, however it does work.