Merge pull request #6334 from nextcloud/fix-mixup-of-id-and-name

Fix naming of user id in email meta data
This commit is contained in:
Morris Jobke 2017-09-04 11:43:41 +02:00 committed by GitHub
commit d21713d526
1 changed files with 4 additions and 4 deletions

View File

@ -118,14 +118,14 @@ class NewUserMailHelper {
$emailTemplate = $this->mailer->createEMailTemplate(); $emailTemplate = $this->mailer->createEMailTemplate();
$emailTemplate->addHeader(); $emailTemplate->addHeader();
$displayName = $user->getDisplayName(); $displayName = $user->getDisplayName();
$userName = $user->getUID(); $userId = $user->getUID();
if ($displayName === $userName) { if ($displayName === $userId) {
$emailTemplate->addHeading($this->l10n->t('Welcome aboard')); $emailTemplate->addHeading($this->l10n->t('Welcome aboard'));
} else { } else {
$emailTemplate->addHeading($this->l10n->t('Welcome aboard %s', [$displayName])); $emailTemplate->addHeading($this->l10n->t('Welcome aboard %s', [$displayName]));
} }
$emailTemplate->addBodyText($this->l10n->t('You have now an %s account, you can add, protect, and share your data.', [$this->themingDefaults->getName()])); $emailTemplate->addBodyText($this->l10n->t('You have now an %s account, you can add, protect, and share your data.', [$this->themingDefaults->getName()]));
$emailTemplate->addBodyText($this->l10n->t('Your username is: %s', [$userName])); $emailTemplate->addBodyText($this->l10n->t('Your username is: %s', [$userId]));
if ($generatePasswordResetToken) { if ($generatePasswordResetToken) {
$leftButtonText = $this->l10n->t('Set your password'); $leftButtonText = $this->l10n->t('Set your password');
} else { } else {
@ -142,7 +142,7 @@ class NewUserMailHelper {
$emailTemplate->setMetaData('settings.Welcome', [ $emailTemplate->setMetaData('settings.Welcome', [
'link' => $link, 'link' => $link,
'displayname' => $displayName, 'displayname' => $displayName,
'username' => $userName, 'userid' => $userId,
'instancename' => $this->themingDefaults->getName(), 'instancename' => $this->themingDefaults->getName(),
'resetTokenGenerated' => $generatePasswordResetToken, 'resetTokenGenerated' => $generatePasswordResetToken,
]); ]);