Change Invited people username & name by default?


#1

Hi,

My forum is for entrepreneurs, companies. So mostly the invited people have the email like info@example.com, support@example.com. So when I invite these people all get the same username and name by default like info1, info2, support3 and so on.

What I want is the forum should automatically set the username and name to their domain
e.g. if the email is info@example.com - then the username & name should be domain name of the invited person - example

info@discourse.org - discourse

How can I do this?


(Robert) #2

You would need to patch Discourse. Have a look here:


#3

Thanks for the help. How can I overwrite the file?


(Kane York) #4

Here you go:

Can you think of any others? If so, reply and I’ll change it.


(Robert) #5

I guess you went for the recommended docker install. In this case, it’s a bit
difficult.

Naive approach:

  • ./launcher ssh your-app

Than you can change the file in /var/www/discourse/ .
You would need to reboot afterwards. However, on your next Discourse update
using docker, the change would be lost.

So it might be better to create a dedicated template for this:

However, if the template is applied before discourse files are in place, this
doesn’t help you.

You could also try to define a docker volume that overwrites the visibility of
that particular file. You could also run a custom command to change the file.
This might be the most easiest solution. Change your file. create a patch file
and pipe in the patch file from a shell here document right from the yml
container description.

Once you got it working, please post your solution!