Customising welcome emails in snap version

I am setting up NextCloud on a PC on my LAN for some friends to use. I have it installed and am now customising it. I want to customise the Welcome email beyond the settings in the Admin screen (colour and logo) such as changing the link from https://localhost/ to the correct URL. To do so I need to change NewUserMailHelper.php or EMailTemplate.php

For example, I have seen other comments on here about changing function addBodyButtonGroup to hardcode the URL to my site.

However, those files are in /snap/nextcloud/28088/htdocs/apps/setings/lib/Mailer and, being a snap installation, cannot be edited.

Is there an alternative solution to this?

I have found a workaround, but it is not a solution.

If I fire up a TOR browser, then log in as admin and send the welcome email, because it is not running on localhost but is coming in via some site out on the Interwebs, it then picks up the URL of the site and includes that in the welcome email. It is a faff, and it is a workaround. I would rather:

  • be able to specify the URL that goes into the Welcome email
    OR
  • have it work out the URL that is not 127.0.0.1 or localhost and use that
    AND
  • be able to implement that change in a snap installation.

Is your Nextcloud running on your work computer? This is probably not the best idea for various reasons… :wink:

Anyways. The solution would be to use the external URL for Nextcloud also inside the local network, or in your case inside your local PC/server. To make this work, you could add the following line to the /etc/hosts file of your computer.

 127.0.0.1	cloud.yourdomain.tld