diff --git a/apps/server/src/modules/server/api/dto/config.response.ts b/apps/server/src/modules/server/api/dto/config.response.ts index db9751b6289..98e1b4c153a 100644 --- a/apps/server/src/modules/server/api/dto/config.response.ts +++ b/apps/server/src/modules/server/api/dto/config.response.ts @@ -8,6 +8,9 @@ export class ConfigResponse { @ApiProperty() ACCESSIBILITY_REPORT_EMAIL: string; + @ApiProperty() + SC_CONTACT_EMAIL: string; + @ApiProperty() FEATURE_NEW_SCHOOL_ADMINISTRATION_PAGE_AS_DEFAULT_ENABLED: boolean; @@ -232,6 +235,7 @@ export class ConfigResponse { constructor(config: ServerConfig) { this.ACCESSIBILITY_REPORT_EMAIL = config.ACCESSIBILITY_REPORT_EMAIL; + this.SC_CONTACT_EMAIL = config.SC_CONTACT_EMAIL; this.ADMIN_TABLES_DISPLAY_CONSENT_COLUMN = config.ADMIN_TABLES_DISPLAY_CONSENT_COLUMN; this.ALERT_STATUS_URL = config.ALERT_STATUS_URL; this.CALENDAR_SERVICE_ENABLED = config.CALENDAR_SERVICE_ENABLED; diff --git a/apps/server/src/modules/server/api/test/server.api.spec.ts b/apps/server/src/modules/server/api/test/server.api.spec.ts index 7709c80be0e..7d8788c7394 100644 --- a/apps/server/src/modules/server/api/test/server.api.spec.ts +++ b/apps/server/src/modules/server/api/test/server.api.spec.ts @@ -92,6 +92,7 @@ describe('Server Controller (API)', () => { 'ROCKETCHAT_SERVICE_ENABLED', 'SC_THEME', 'SC_TITLE', + 'SC_CONTACT_EMAIL', 'TRAINING_URL', 'TEACHER_STUDENT_VISIBILITY__IS_CONFIGURABLE', 'TEACHER_STUDENT_VISIBILITY__IS_ENABLED_BY_DEFAULT', diff --git a/apps/server/src/modules/server/server.config.ts b/apps/server/src/modules/server/server.config.ts index b73935f0293..9086bbfd07d 100644 --- a/apps/server/src/modules/server/server.config.ts +++ b/apps/server/src/modules/server/server.config.ts @@ -82,6 +82,7 @@ export interface ServerConfig SC_DOMAIN: string; HOST: string; ACCESSIBILITY_REPORT_EMAIL: string; + SC_CONTACT_EMAIL: string; ADMIN_TABLES_DISPLAY_CONSENT_COLUMN: boolean; ALERT_STATUS_URL: string | null; CALENDAR_SERVICE_ENABLED: boolean; @@ -131,6 +132,7 @@ export interface ServerConfig const config: ServerConfig = { ACCESSIBILITY_REPORT_EMAIL: Configuration.get('ACCESSIBILITY_REPORT_EMAIL') as string, + SC_CONTACT_EMAIL: Configuration.get('SC_CONTACT_EMAIL') as string, ADMIN_TABLES_DISPLAY_CONSENT_COLUMN: Configuration.get('ADMIN_TABLES_DISPLAY_CONSENT_COLUMN') as boolean, ALERT_STATUS_URL: Configuration.get('ALERT_STATUS_URL') === null diff --git a/config/default.schema.json b/config/default.schema.json index 9b286223b19..086aadf80ae 100644 --- a/config/default.schema.json +++ b/config/default.schema.json @@ -1184,6 +1184,11 @@ "default": "/login", "description": "Determines the url to be redirected to when the user is not authenticated" }, + "SC_CONTACT_EMAIL": { + "type": "string", + "default": "ticketsystem@dbildungscloud.de", + "description": "Email address used for contacting" + }, "ACCESSIBILITY_REPORT_EMAIL": { "type": "string", "default": "dbildungscloud@dataport.de", diff --git a/test/services/helpdesk/index.test.js b/test/services/helpdesk/index.test.js index f344cec0df9..03437c4c76e 100644 --- a/test/services/helpdesk/index.test.js +++ b/test/services/helpdesk/index.test.js @@ -135,9 +135,9 @@ describe('helpdesk service', function test() { const mailService = new MockMailService(); app.use('/mails', mailService); const tempScTheme = Configuration.get('SUPPORT_PROBLEM_EMAIL_ADDRESS'); - Configuration.set('SUPPORT_PROBLEM_EMAIL_ADDRESS', 'nbc-support@netz-21.de'); + Configuration.set('SUPPORT_PROBLEM_EMAIL_ADDRESS', 'ticketsystem@niedersachsen.support'); await helpdeskService.create(postBody, { account: { userId: '0000d213816abba584714c0a' } }); - expect(mailService.create.firstArg.email).to.equal('nbc-support@netz-21.de'); + expect(mailService.create.firstArg.email).to.equal('ticketsystem@niedersachsen.support'); Configuration.set('SUPPORT_PROBLEM_EMAIL_ADDRESS', tempScTheme); }); @@ -169,10 +169,13 @@ describe('helpdesk service', function test() { const mailService = new MockMailService(); app.use('/mails', mailService); const tempScTheme = Configuration.get('SUPPORT_WISH_EMAIL_ADDRESS'); - Configuration.set('SUPPORT_WISH_EMAIL_ADDRESS', 'nbc-wunsch@netz-21.de,ticketsystem@dbildungscloud.de'); + Configuration.set( + 'SUPPORT_WISH_EMAIL_ADDRESS', + 'ticketsystem@niedersachsen.support,ticketsystem@dbildungscloud.de' + ); await helpdeskService.create(postBody, { account: { userId: '0000d213816abba584714c0a' } }); expect(mailService.create.args.length).to.equal(2); - expect(mailService.create.args[0][0].email).to.equal('nbc-wunsch@netz-21.de'); + expect(mailService.create.args[0][0].email).to.equal('ticketsystem@niedersachsen.support'); expect(mailService.create.args[1][0].email).to.equal('ticketsystem@dbildungscloud.de'); Configuration.set('SUPPORT_WISH_EMAIL_ADDRESS', tempScTheme); });