|
|
@@ -1,5 +1,5 @@
|
|
|
module.exports = function(crowi, app) {
|
|
|
- const { /* appService, */ mailService } = crowi;
|
|
|
+ const { /* appService, */ mailService, configManager } = crowi;
|
|
|
const path = require('path');
|
|
|
const actions = {};
|
|
|
const api = {};
|
|
|
@@ -14,13 +14,12 @@ module.exports = function(crowi, app) {
|
|
|
};
|
|
|
|
|
|
|
|
|
- async function sendPasswordResetEmail() {
|
|
|
+ async function sendPasswordResetEmail(i18n) {
|
|
|
|
|
|
return mailService.send({
|
|
|
to: 'hoge@gmail.com',
|
|
|
subject: 'forgotPasswordMailTest',
|
|
|
- // TODO: apply i18n by GW-6833
|
|
|
- template: path.join(crowi.localeDir, 'en_US/notifications/passwordReset.txt'),
|
|
|
+ template: path.join(crowi.localeDir, `${i18n}/notifications/passwordReset.txt`),
|
|
|
// TODO: need to set appropriate values by GW-6828
|
|
|
// vars: {
|
|
|
// appTitle: appService.getAppTitle(),
|
|
|
@@ -31,7 +30,10 @@ module.exports = function(crowi, app) {
|
|
|
}
|
|
|
|
|
|
api.post = async function(req, res) {
|
|
|
- await sendPasswordResetEmail();
|
|
|
+ const grobalLang = configManager.getConfig('crowi', 'app:globalLang');
|
|
|
+ const i18n = req.language || grobalLang;
|
|
|
+
|
|
|
+ await sendPasswordResetEmail(i18n);
|
|
|
return;
|
|
|
};
|
|
|
|