You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-12-20 23:30:05 +02:00
Server: Fixed support emails
This commit is contained in:
@@ -43,6 +43,8 @@ export interface EnvVariables {
|
|||||||
ERROR_STACK_TRACES?: string;
|
ERROR_STACK_TRACES?: string;
|
||||||
|
|
||||||
SUPPORT_EMAIL?: string;
|
SUPPORT_EMAIL?: string;
|
||||||
|
SUPPORT_NAME?: string;
|
||||||
|
|
||||||
BUSINESS_EMAIL?: string;
|
BUSINESS_EMAIL?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,6 +137,7 @@ export async function initConfig(envType: Env, env: EnvVariables, overrides: any
|
|||||||
const packageJson = await readPackageJson(`${rootDir}/package.json`);
|
const packageJson = await readPackageJson(`${rootDir}/package.json`);
|
||||||
const stripePublicConfig = loadStripeConfig(envType === Env.BuildTypes ? Env.Dev : envType, `${rootDir}/stripeConfig.json`);
|
const stripePublicConfig = loadStripeConfig(envType === Env.BuildTypes ? Env.Dev : envType, `${rootDir}/stripeConfig.json`);
|
||||||
|
|
||||||
|
const appName = env.APP_NAME || 'Joplin Server';
|
||||||
const viewDir = `${rootDir}/src/views`;
|
const viewDir = `${rootDir}/src/views`;
|
||||||
const appPort = env.APP_PORT ? Number(env.APP_PORT) : 22300;
|
const appPort = env.APP_PORT ? Number(env.APP_PORT) : 22300;
|
||||||
const baseUrl = baseUrlFromEnv(env, appPort);
|
const baseUrl = baseUrlFromEnv(env, appPort);
|
||||||
@@ -143,7 +146,7 @@ export async function initConfig(envType: Env, env: EnvVariables, overrides: any
|
|||||||
|
|
||||||
config_ = {
|
config_ = {
|
||||||
appVersion: packageJson.version,
|
appVersion: packageJson.version,
|
||||||
appName: env.APP_NAME || 'Joplin Server',
|
appName,
|
||||||
isJoplinCloud: apiBaseUrl.includes('.joplincloud.com'),
|
isJoplinCloud: apiBaseUrl.includes('.joplincloud.com'),
|
||||||
env: envType,
|
env: envType,
|
||||||
rootDir: rootDir,
|
rootDir: rootDir,
|
||||||
@@ -163,6 +166,7 @@ export async function initConfig(envType: Env, env: EnvVariables, overrides: any
|
|||||||
termsEnabled: env.TERMS_ENABLED === '1',
|
termsEnabled: env.TERMS_ENABLED === '1',
|
||||||
accountTypesEnabled: env.ACCOUNT_TYPES_ENABLED === '1',
|
accountTypesEnabled: env.ACCOUNT_TYPES_ENABLED === '1',
|
||||||
supportEmail,
|
supportEmail,
|
||||||
|
supportName: env.SUPPORT_NAME || appName,
|
||||||
businessEmail: env.BUSINESS_EMAIL || supportEmail,
|
businessEmail: env.BUSINESS_EMAIL || supportEmail,
|
||||||
...overrides,
|
...overrides,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -52,6 +52,13 @@ export default class EmailService extends BaseService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (senderId === EmailSender.Support) {
|
||||||
|
return {
|
||||||
|
name: this.config.supportName,
|
||||||
|
email: this.config.supportEmail,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
throw new Error(`Invalid sender ID: ${senderId}`);
|
throw new Error(`Invalid sender ID: ${senderId}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ export interface Config {
|
|||||||
mailer: MailerConfig;
|
mailer: MailerConfig;
|
||||||
stripe: StripeConfig;
|
stripe: StripeConfig;
|
||||||
supportEmail: string;
|
supportEmail: string;
|
||||||
|
supportName: string;
|
||||||
businessEmail: string;
|
businessEmail: string;
|
||||||
isJoplinCloud: boolean;
|
isJoplinCloud: boolean;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user