|
@@ -11,7 +11,6 @@ class GlobalNotificationMailService {
|
|
|
this.mailer = crowi.getMailer();
|
|
this.mailer = crowi.getMailer();
|
|
|
this.type = crowi.model('GlobalNotificationSetting').TYPE.MAIL;
|
|
this.type = crowi.model('GlobalNotificationSetting').TYPE.MAIL;
|
|
|
this.event = crowi.model('GlobalNotificationSetting').EVENT;
|
|
this.event = crowi.model('GlobalNotificationSetting').EVENT;
|
|
|
- this.defaultLang = crowi.configManager.getConfig('crowi', 'app:globalLang');
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -48,12 +47,13 @@ class GlobalNotificationMailService {
|
|
|
* @return {{ subject: string, template: string, vars: object }}
|
|
* @return {{ subject: string, template: string, vars: object }}
|
|
|
*/
|
|
*/
|
|
|
generateOption(event, path, triggeredBy, { comment, oldPath }) {
|
|
generateOption(event, path, triggeredBy, { comment, oldPath }) {
|
|
|
|
|
+ const defaultLang = this.crowi.configManager.getConfig('crowi', 'app:globalLang');
|
|
|
// validate for all events
|
|
// validate for all events
|
|
|
if (event == null || path == null || triggeredBy == null) {
|
|
if (event == null || path == null || triggeredBy == null) {
|
|
|
throw new Error(`invalid vars supplied to GlobalNotificationMailService.generateOption for event ${event}`);
|
|
throw new Error(`invalid vars supplied to GlobalNotificationMailService.generateOption for event ${event}`);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- const template = nodePath.join(this.crowi.localeDir, `${this.defaultLang}/notifications/${event}.txt`);
|
|
|
|
|
|
|
+ const template = nodePath.join(this.crowi.localeDir, `${defaultLang}/notifications/${event}.txt`);
|
|
|
let subject;
|
|
let subject;
|
|
|
let vars = {
|
|
let vars = {
|
|
|
appTitle: this.crowi.appService.getAppTitle(),
|
|
appTitle: this.crowi.appService.getAppTitle(),
|