More work in email translations

This commit is contained in:
vjrj 2018-01-23 12:50:04 +01:00
parent af042b8722
commit c67609b417
9 changed files with 37 additions and 20 deletions

View file

@ -3,15 +3,17 @@ import sendWelcomeEmail from '../../../api/Users/server/send-welcome-email';
Accounts.onCreateUser((options, user) => {
const userToCreate = user;
console.log(JSON.stringify(user));
console.log(JSON.stringify(options));
// console.log(JSON.stringify(user));
// console.log(JSON.stringify(options));
let lang = 'en'; // fallback
if (options.profile) {
userToCreate.profile = options.profile;
userToCreate.lang = options.profile.lang;
lang = options.profile.lang;
delete options.profile.lang;
} else {
// TODO others (google, etc) ?
}
sendWelcomeEmail(options, userToCreate);
sendWelcomeEmail(options, userToCreate, lang);
return userToCreate;
});