The discussion revolves around displaying user email addresses for all registered members in a Discourse forum. brucewayne wants to achieve this by making email addresses visible to every member from the user’s summary page.
IAmGav suggests creating a custom field as the easiest solution, which brucewayne later confirms as the best approach.
hawm mentions that overriding the can_check_emails? method in user_guardian.rb could be a solution but raises concerns about making email addresses publicly available. IAmGav agrees that modifying the source code is not ideal as changes would be lost after an update.
merefield advises against making email addresses fully public to avoid attracting crawlers and unwanted attention. brucewayne clarifies that the intention is to make email addresses visible to members only, not publicly.
For those interested in overriding existing Discourse methods in plugins, hawm provides a link to a relevant topic.
I am trying to give a public access to all user email addresses.
To be more precise, I would like that every registered member (not only admins) would have an access to a user email address from its member card.
In other words, every member could read an other member email addess from the link : https://meta.discourse.org/{user}/summary
I tried to modify the file user.hbs, but it seems that only admins have an access to email addresses data.
Is there a way to open the data not only for admins ?
Thank you all for your help !
Best solution is indeed to create a custom field, thank you Gavin.
Here is the reason why I need to display email addresses for every members :
The Discourse forum on which I’m working is designed for my school network.
The goal is to create a community for graduates and non-graduates people.
Thus, displaying email addresses is a good way to share useful information.
Hawn → just because I’m too curious. How could I have modified the file user_guardian.rb in which the method can_check_emails is stored ?
I know it is possible to modify templates such as .hbs files with plugin-outlet.
But it seems the following script is only designed for template, and not for .rb files :