diff --git a/backend/src/config/index.js b/backend/src/config/index.js index 0f024b670..96fcac44a 100644 --- a/backend/src/config/index.js +++ b/backend/src/config/index.js @@ -1,5 +1,6 @@ import dotenv from 'dotenv' import links from './links.js' +import metadata from './metadata.js' if (require.resolve) { // are we in a nodejs environment? @@ -94,6 +95,7 @@ export const s3Configs = { export const customConfigs = { EMAIL_DEFAULT_SENDER, SUPPORT_URL: links.SUPPORT, + APPLICATION_NAME: metadata.APPLICATION_NAME, } export default { diff --git a/backend/src/config/metadata.js b/backend/src/config/metadata.js new file mode 100644 index 000000000..6017cd1af --- /dev/null +++ b/backend/src/config/metadata.js @@ -0,0 +1,7 @@ +export default { + APPLICATION_NAME: 'fyphe_O', + APPLICATION_SHORT_NAME: 'fyphe', + APPLICATION_DESCRIPTION: 'The Schools in Motion Network', + ORGANIZATION_NAME: 'Ensible e.V.', + ORGANIZATION_JURISDICTION: 'Köln', +} diff --git a/backend/src/middleware/email/templateBuilder.js b/backend/src/middleware/email/templateBuilder.js index 1a0aad9d5..28acb633e 100644 --- a/backend/src/middleware/email/templateBuilder.js +++ b/backend/src/middleware/email/templateBuilder.js @@ -4,11 +4,16 @@ import CONFIG from '../../config' import * as templates from './templates' const from = CONFIG.EMAIL_DEFAULT_SENDER -const supportUrl = CONFIG.SUPPORT_URL const welcomeImageUrl = new URL(`/img/custom/welcome.svg`, CONFIG.CLIENT_URI) +const defaultParams = { + supportUrl: CONFIG.SUPPORT_URL, + APPLICATION_NAME: CONFIG.APPLICATION_NAME, + welcomeImageUrl +} + export const signupTemplate = ({ email, nonce }) => { - const subject = 'Willkommen, Bienvenue, Welcome to Human Connection!' + const subject = `Willkommen, Bienvenue, Welcome to ${CONFIG.APPLICATION_NAME}!` const actionUrl = new URL('/registration/create-user-account', CONFIG.CLIENT_URI) actionUrl.searchParams.set('nonce', nonce) actionUrl.searchParams.set('email', email) @@ -19,7 +24,7 @@ export const signupTemplate = ({ email, nonce }) => { subject, html: mustache.render( templates.layout, - { actionUrl, nonce, supportUrl, welcomeImageUrl, subject }, + { ...defaultParams, actionUrl, nonce, subject }, { content: templates.signup }, ), } @@ -37,7 +42,7 @@ export const emailVerificationTemplate = ({ email, nonce, name }) => { subject, html: mustache.render( templates.layout, - { actionUrl, name, nonce, supportUrl, welcomeImageUrl, subject }, + { ...defaultParams, actionUrl, name, nonce, subject }, { content: templates.emailVerification }, ), } @@ -55,7 +60,7 @@ export const resetPasswordTemplate = ({ email, nonce, name }) => { subject, html: mustache.render( templates.layout, - { actionUrl, name, nonce, supportUrl, welcomeImageUrl, subject }, + { ...defaultParams, actionUrl, name, nonce, subject }, { content: templates.passwordReset }, ), } diff --git a/backend/src/middleware/email/templates/emailVerification.html b/backend/src/middleware/email/templates/emailVerification.html index dda8684ec..9982ad192 100644 --- a/backend/src/middleware/email/templates/emailVerification.html +++ b/backend/src/middleware/email/templates/emailVerification.html @@ -7,7 +7,7 @@
Sollte der Button für Dich nicht funktionieren, kannst Du auch folgenden Code in Dein Browserfenster kopieren: {{{ nonce }}}
Bis bald bei Human Connection!
-– Dein Human Connection Team
+ style="color: #17b53e;">{{{APPLICATION_NAME}}}! +– Dein {{APPLICATION_NAME}} Team
If the above button doesn't work you can also copy the following code into your browser window: {{{ nonce }}}
See you soon on Human Connection!
-– The Human Connection Team
+ style="color: #17b53e;">{{{APPLICATION_NAME}}}! +– The {{APPLICATION_NAME}} Team
Sollte der Button für Dich nicht funktionieren, kannst Du auch folgenden Code in Dein Browserfenster kopieren: {{{ nonce }}}
Bis bald bei Human Connection!
-– Dein Human Connection Team
+ style="color: #17b53e;">{{APPLICATION_NAME}}! +– Dein {{APPLICATION_NAME}} Team
If the above button doesn't work you can also copy the following code into your browser window: {{{ nonce }}}
See you soon on Human Connection!
-– The Human Connection Team
+ style="color: #17b53e;">{{APPLICATION_NAME}}! +– The {{APPLICATION_NAME}} Team
Danke, dass Du dich angemeldet hast – wir freuen uns, Dich dabei zu haben. Jetzt fehlt nur noch eine Kleinigkeit, bevor wir gemeinsam die Welt verbessern können ... Bitte bestätige Deine E-Mail Adresse:
@@ -63,7 +63,7 @@Sollte der Button für Dich nicht funktionieren, kannst Du auch folgenden Code in Dein Browserfenster kopieren: {{{ nonce }}}
Das funktioniert allerdings nur, wenn du Dich über unsere Website registriert hast.
Falls Du Dich nicht selbst bei Human Connection angemeldet hast, schau doch mal vorbei! + style="color: #17b53e;">{{APPLICATION_NAME}} angemeldet hast, schau doch mal vorbei! Wir sind ein gemeinnütziges Aktionsnetzwerk – von Menschen für Menschen.
PS: Wenn Du keinen Account bei uns möchtest, kannst Du diese E-Mail einfach ignorieren. ;)
@@ -88,8 +88,8 @@Melde Dich gerne bei unserem Support Team, wenn Du Fragen hast.
Bis bald bei Human Connection!
-– Dein Human Connection Team
+ style="color: #17b53e;">{{APPLICATION_NAME}}! +– Dein {{APPLICATION_NAME}} Team
Thank you for joining our cause – it's awesome to have you on board. There's just one tiny step missing before we can start shaping the world together ... Please confirm your e-mail address by clicking the button below:
@@ -174,7 +174,7 @@If the above button doesn't work, you can also copy the following code into your browser window: {{{ nonce }}}
However, this only works if you have registered through our website.
If you didn't sign up for Human Connection we recommend you to check it out! + style="color: #17b53e;">{{APPLICATION_NAME}} we recommend you to check it out! It's a social network from people for people who want to connect and change the world together.
PS: If you ignore this e-mail we will not create an account for @@ -201,8 +201,8 @@ support team with any questions you have.
See you soon on Human Connection!
-– The Human Connection Team
+ style="color: #17b53e;">{{APPLICATION_NAME}}! +– The {{APPLICATION_NAME}} Team
Wenn Du noch keinen Account bei Human Connection hast oder Dein Password gar nicht ändern willst, + style="color: #17b53e;">{{APPLICATION_NAME}} hast oder Dein Password gar nicht ändern willst, kannst Du diese E-Mail einfach ignorieren!
Ansonsten hilft Dir unser Support Team gerne weiter.
Bis bald bei Human Connection!
-– Dein Human Connection Team
+ style="color: #17b53e;">{{APPLICATION_NAME}}! +– Dein {{APPLICATION_NAME}} Team
If you don't have an account at Human Connection yet or if you didn't want to reset your password, + style="color: #17b53e;">{{APPLICATION_NAME}} yet or if you didn't want to reset your password, please ignore this e-mail.
Otherwise our support team will be happy to help you out.
See you soon on Human Connection!
-– The Human Connection Team
+ style="color: #17b53e;">{{APPLICATION_NAME}}! +– The {{APPLICATION_NAME}} Team