diff --git a/src/backend/src/services/EmailService.js b/src/backend/src/services/EmailService.js index f5ab32ede..e5235d750 100644 --- a/src/backend/src/services/EmailService.js +++ b/src/backend/src/services/EmailService.js @@ -50,9 +50,9 @@ The Puter Team html: `

Hi{{#if owner_username}} {{owner_username}}{{/if}},

-Thanks for submitting {{app_title}} for the Puter App Center. We reviewed your listing and have rejected it for the following reason: +Thanks for submitting {{app_title}} for the Puter App Center. We reviewed your listing and have rejected it for the following reason(s):

-
{{reason}}
+
{{{nl2br reason}}}

Please update your app listing and resubmit when ready. If you have questions, just reply to this email.

@@ -219,6 +219,17 @@ class Emailservice extends BaseService { _construct () { this.templates = TEMPLATES; + const handlebars = this.modules.handlebars; + handlebars.registerHelper('nl2br', (text) => { + if ( text == null ) return ''; + const s = String(text) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); + return new handlebars.SafeString(s.replace(/\n/g, '
')); + }); + this.template_fns = {}; for ( const k in this.templates ) { const template = this.templates[k];