Lang for oauth users

This commit is contained in:
vjrj 2018-02-12 19:52:22 +01:00
parent 47b55267df
commit 08b3289f4d
6 changed files with 42 additions and 25 deletions

View file

@ -10,11 +10,12 @@ export default (options, user, lang) => {
const applicationName = i18n.t('AppName');
const firstName = OAuthProfile ? OAuthProfile.name.first : options.profile.name.first;
const emailAddress = OAuthProfile ? OAuthProfile.email : options.email;
const welcome = i18n.t('welcome');
if (emailAddress) {
sendEmail({
to: emailAddress,
from: `${applicationName} <noreply@comunes.org>`,
subject: `[${applicationName}] Welcome, ${firstName}!`,
subject: `[${applicationName}] ${welcome} ${firstName}!`,
lang,
template: 'welcome',
templateVars: {