rename core-module environment to twenty-config (#11445)

closes https://github.com/twentyhq/core-team-issues/issues/759
This commit is contained in:
nitin
2025-04-09 17:41:26 +05:30
committed by GitHub
parent fe6d0241a8
commit bd3ec6d5e3
193 changed files with 1454 additions and 1422 deletions

View File

@ -3,12 +3,12 @@ import {
EmailModuleOptions,
} from 'src/engine/core-modules/email/interfaces/email.interface';
import { EnvironmentService } from 'src/engine/core-modules/environment/environment.service';
import { TwentyConfigService } from 'src/engine/core-modules/twenty-config/twenty-config.service';
export const emailModuleFactory = (
environmentService: EnvironmentService,
twentyConfigService: TwentyConfigService,
): EmailModuleOptions => {
const driver = environmentService.get('EMAIL_DRIVER');
const driver = twentyConfigService.get('EMAIL_DRIVER');
switch (driver) {
case EmailDriver.Logger:
@ -21,11 +21,11 @@ export const emailModuleFactory = (
type: EmailDriver.Smtp,
};
const host = environmentService.get('EMAIL_SMTP_HOST');
const port = environmentService.get('EMAIL_SMTP_PORT');
const user = environmentService.get('EMAIL_SMTP_USER');
const pass = environmentService.get('EMAIL_SMTP_PASSWORD');
const noTLS = environmentService.get('EMAIL_SMTP_NO_TLS');
const host = twentyConfigService.get('EMAIL_SMTP_HOST');
const port = twentyConfigService.get('EMAIL_SMTP_PORT');
const user = twentyConfigService.get('EMAIL_SMTP_USER');
const pass = twentyConfigService.get('EMAIL_SMTP_PASSWORD');
const noTLS = twentyConfigService.get('EMAIL_SMTP_NO_TLS');
if (!host || !port) {
throw new Error(