diff --git a/backend/src/middleware/email/templates/signup.js b/backend/src/middleware/email/templates/signup.js index 54cc51be2..25f3681d7 100644 --- a/backend/src/middleware/email/templates/signup.js +++ b/backend/src/middleware/email/templates/signup.js @@ -1,4 +1,9 @@ import CONFIG from '../../../config' +import fs from 'fs' +import path from 'path' +import mustache from 'mustache' + +const signupText = fs.readFileSync(path.join(__dirname, './signup.txt'), 'utf-8') export const signupTemplate = options => { const { @@ -11,52 +16,11 @@ export const signupTemplate = options => { actionUrl.searchParams.set('nonce', nonce) actionUrl.searchParams.set('email', email) + console.log(actionUrl) + return { to: email, subject, - text: ` -Willkommen bei Human Connection! Klick auf diesen Link, um den -Registrierungsprozess abzuschließen und um ein Benutzerkonto zu erstellen! - -${actionUrl} - -Alternativ kannst du diesen Code auch kopieren und im Browserfenster einfügen: - -${nonce} - -Bitte ignoriere diese Mail, falls du dich nicht bei Human Connection angemeldet -hast. Bei Fragen kontaktiere gerne unseren Support: - -${supportUrl} - -Danke, -Das Human Connection Team - - -English Version -=============== - -Welcome to Human Connection! Use this link to complete the registration process -and create a user account: - -${actionUrl} - -You can also copy+paste this verification nonce in your browser window: - -${nonce} - -If you did not signed up for Human Connection, please ignore this email or -contact support if you have questions: - -${supportUrl} - -Thanks, -The Human Connection Team - -Human Connection gemeinnützige GmbH -Bahnhofstr. 11 -73235 Weilheim / Teck -Deutschland - `, + text: mustache.render(signupText, { actionUrl, nonce, supportUrl }) } } diff --git a/backend/src/middleware/email/templates/signup.txt b/backend/src/middleware/email/templates/signup.txt new file mode 100644 index 000000000..c3e2ba8c6 --- /dev/null +++ b/backend/src/middleware/email/templates/signup.txt @@ -0,0 +1,42 @@ +Willkommen bei Human Connection! Klick auf diesen Link, um den +Registrierungsprozess abzuschließen und um ein Benutzerkonto zu erstellen! + +{{{actionUrl}}} + +Alternativ kannst du diesen Code auch kopieren und im Browserfenster einfügen: + +{{{nonce}}} + +Bitte ignoriere diese Mail, falls du dich nicht bei Human Connection angemeldet +hast. Bei Fragen kontaktiere gerne unseren Support: + +{{{supportUrl}}} + +Danke, +Das Human Connection Team + + +English Version +=============== + +Welcome to Human Connection! Use this link to complete the registration process +and create a user account: + +{{{actionUrl}}} + +You can also copy+paste this verification nonce in your browser window: + +{{{nonce}}} + +If you did not signed up for Human Connection, please ignore this email or +contact support if you have questions: + +{{{supportUrl}}} + +Thanks, +The Human Connection Team + +Human Connection gemeinnützige GmbH +Bahnhofstr. 11 +73235 Weilheim / Teck +Deutschland