Skip to content

Commit f7b645d

Browse files
committed
fix email language select
1 parent bb91fdb commit f7b645d

File tree

3 files changed

+23
-9
lines changed

3 files changed

+23
-9
lines changed

email-templates/account/reset-password/de/html.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
</tr>
2121
<tr>
2222
<td class="aligncenter content-block">
23-
Wenn du diese Nachricht ignorierst bleibt dein Passwort, wie es ist.
23+
Wenn du diese Nachricht ignorierst, bleibt dein Passwort wie es ist.
2424
</td>
2525
</tr>
2626
<tr>
2727
<td class="aligncenter content-block" itemprop="handler" itemscope itemtype="http://schema.org/HttpActionHandler">
28-
Wenn du es nicht warst, der dein Passwort zurücksetzen wollte <a href='mailto:{{returnEmail}}?subject=I did not reset my password&body=Someone unauthorized sent this reset password request.'>lass es uns wissen!</a>
28+
Wenn du es nicht warst, der dein Passwort zurücksetzen wollte, <a href='mailto:{{returnEmail}}?subject=I did not reset my password&body=Someone unauthorized sent this reset password request.'>lass es uns wissen!</a>
2929
</td>
3030
</tr>
3131
<tr>

server/services/auth-management/notifier.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,14 @@ module.exports = function (app) {
3737
)
3838
);
3939

40+
let language = user.userSettings && user.userSettings.uiLanguage ?
41+
user.userSettings.uiLanguage : 'en';
42+
4043
const templatePath = path.join(
4144
__dirname,
4245
'../../../email-templates/account',
4346
templatename,
44-
user.language || 'en'
47+
language
4548
);
4649

4750
let token;

server/services/users/users.hooks.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,25 @@ const candosSchema = {
4949
}
5050
};
5151

52+
const userSettingsPrivateSchema = {
53+
include: {
54+
service: 'usersettings',
55+
nameAs: 'userSettings',
56+
parentField: '_id',
57+
childField: 'userId',
58+
asArray: false
59+
}
60+
};
61+
5262
const userSettingsSchema = {
5363
include: {
5464
service: 'usersettings',
5565
nameAs: 'userSettings',
5666
parentField: '_id',
5767
childField: 'userId',
68+
query: {
69+
$select: ['uiLanguage', 'contentLanguages'],
70+
},
5871
asArray: false
5972
}
6073
};
@@ -139,6 +152,7 @@ module.exports = {
139152
all: [
140153
populate({ schema: badgesSchema }),
141154
populate({ schema: candosSchema }),
155+
populate({ schema: userSettingsSchema }),
142156
cleanupBasicData
143157
],
144158
find: [
@@ -147,15 +161,12 @@ module.exports = {
147161
],
148162
get: [
149163
thumbnails(thumbnailOptions),
150-
151164
// remove personal data if its not the current authenticated user
152-
iff(isProvider('external'),
153-
when(isOwnEntry(false), [
154-
cleanupPersonalData
155-
])
165+
iff(isOwnEntry(false),
166+
cleanupPersonalData,
156167
),
157168
iff(isOwnEntry(),
158-
populate({ schema: userSettingsSchema })
169+
populate({ schema: userSettingsPrivateSchema })
159170
)
160171
],
161172
create: [

0 commit comments

Comments
 (0)