I’m using Django Userena to configure my user profiles. The site works like this: User#1 creates Object#1 on my site. Afterwards, I want to enable other people to message User#1 about Object#1 using Userena’s messaging system.
I realize that you can get a user’s email like this:
{{ object.user.email }}
but I dont want to expose my user’s emails on the internet and would prefer to use userena’s messaging system.
How would you do this? Would I create a link on the page to userena’s write view, including the username as a parameter?
I have to admit I am pretty lost on how to do this, but as it seems like a common problem, I hope for any good suggestions. Thank you!
You will need to install userna’s messaging framework, by adding
userena.contrib.umessagesto yourINSTALLED_APPSsetting. You also need to add it to your urlconf. For example:Now, if you go to an url like
/messages/compose/username_1+username_2+username_3/then a message can be sent to all those 3 users whose username is in URL.Please have a look at
urls.pyandviews.pyto learn more.If interested, you should look into
models.pyas well to know what all models are being used for this.