How do I change the text of the welcome email?

Unfortunately, there is very little documentation about email theming (especially for a newbie as myself)… The only thing is that section in the documentation: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/email_configuration.html#using-email-templates
For enterprise users, there seems to be a detailed description https://portal.nextcloud.com/article/customized-email-templates-29.html that is even linked in the documentation. That guide however isn’t accessible for non-paid users like me…

First of all, I have to edit the text of the welcome email…
I know that it was possible somehow in NC 17 but I forgot how respectively I cannot find the file anymore which I have to edit in NC 18…
does anyone know what I have to do?

In addition, it would be really great if there was some guide how to edit the design/theme of the mail…

1 Like

please help…!

ok… now I have found the file that contains the text of the welcome email! It’s /var/www/nextcloud/apps/settings/lib/Mailer/NewUserMailHelper.php.

However, it contains only the English text.
The translations seem to be in /var/www/nextcloud/apps/settings/l10n/. Changing all the necessary files is really annoying… :frowning: Is there any way to change all at once???

And: Is there any possibility to make the changes persistent through updates??

I think you must only edit some variables if you do not want to break or change the design.
Perhaps only change the text
addBodyText( ....

"Welcome to your %s account, you can add, protect, and share your data." : "Willkommen zu Deinem %s-Konto. Du kannst Deine Daten hinzufügen, schützen und teilen.",

all fields in the formated e-amail:
$emailTemplate->setSubject($l10n->t('Your %s account was created', [$this->themingDefaults->getName()])); $emailTemplate->addHeading($l10n->t('Welcome aboard')); $emailTemplate->addHeading($l10n->t('Welcome aboard %s', [$displayName])); $emailTemplate->addBodyText($l10n->t('Welcome to your %s account, you can add, protect, and share your data.', [$this->themingDefaults->getName()])); $emailTemplate->addBodyText($l10n->t('Your username is: %s', [$userId])); $leftButtonText = $l10n->t('Set your password'); $leftButtonText = $l10n->t('Go to %s', [$this->themingDefaults->getName()]); $l10n->t('Install Client'),

Perhaps you can additional change the design. in the php-scripts.

I did it now in the following way:

  • First, I changed the English text of the welcome email by editing /var/www/nextcloud/apps/settings/lib/Mailer/NewUserMailHelper.php (Creating new paragraphs goes by copying $emailTemplate->addBodyText($l10n->t( )
  • Then I changed the .json translation files in /var/www/nextcloud/apps/settings/l10n/. The .js files seem to be ignored completely…

However, I still didn’t find any way to keep the changes after an update… Does anyone have an idea?

Furthermore, there is a little css issue concerning the password button in the welcome email https://github.com/nextcloud/server/issues/19255. Can anyone help me with that?

3 Likes

Hi, thanks for this topic!
I would be also very interested. Just want to edit the welcome text, not the template…

The .js files seem to be ignored completely

Same here with other languages.

Operating system: Linux 5.4.0-74-generic #83-Ubuntu
Webserver: Apache/2.4.41 (Ubuntu) (apache2handler)
Database: mysql 10.3.29
PHP version: 7.4.3
Nextcloud fresh install version: 21.0.2 - 21.0.2.1

What about the text of reset password does anybody know which file should I open to edit the text of auto email for reset password ?

Search for your language perhaps here. If you not found it post the message you want to change.

The question came up again. No straighter way for a solution?
Thanks.