Is there a way to force update the Preference of all users in a chat channel to receive email messages for chat?
I would like users to default to receiving emails.
Thank you.
Is there a way to force update the Preference of all users in a chat channel to receive email messages for chat?
I would like users to default to receiving emails.
Thank you.
Why would you do that? Surely the userâs preferences are what they want. When I sign up for a new DIscourse instance the very first thing I do is go to my profile and change the email perferences to Never. I would be royal annoyed to find that someone had decided that they knew better than me about how I wished to interact with Discourse. Indeed if an admin did this to me I would consider it spamming!
Yes, it is not for overriding what the user selects.
However, it would make sense to have initial defaults. It appears that no emails are going out currently, when we enabled the chat functionality.
In our kind of forum, people would not go in to set preferences and expect to be notified adequately.
Iâve just checked my test site, and I believe the default for chat email notifications is âonly when awayâ (with the only alternative being âneverâ).
I think there is a case to allow for a default to be added to the User Preference admin settings, though probably for the inverse of what youâre suggesting. This would work like the other defaults, in that it would only change the preference for users who had yet to select one manually.
Iâve slipped this over to ux for consideration.
Thanks. But shouldnât the default âOnly when awayâ pump out emails to everyone who hasnât been on the site lately?
I had 300+ members on the general chat channel and only 2 messages went out.
Needless to say, most of the 300 werenât on the site in the 15 min window.
You donât get notifications for every chat message, only those where youâve been mentioned (either your own @mention, @here
and @all
), so that may explain it?
Sorry I may not have clarified I used @ all (space added just here) but it didnât work.
P.S. I am actually wondering why you are not added to the chit chat on my site as a recently active member.
Ah, Iâm afraid I deleted my test account on your site after I finished testing the post-voting comments.
Iâve had a quick play on seeing if there are any quirks about when a chat user gets included in @all
, but (from my very brief look) it seemed to be everyone in the channel list. You could pick a couple of users who didnât get the email and check to see if they got the notification, as well as their chat email preference to see if theyâre as they should be?
So here is my test:
1. Chat channel settings to notify for everything (though I think it does not affect emails).
2. I picked a member from the 313 in the channel and here are the standard user prefs - âEmail only when awayâ.
Chat message with @ all created many hours back has sent notifications as seen here, but no emails.
3. No emails sent except for 2 members. Both are admins/mods and both used chat before - not sure if that is the differentiator.
4. On a separate note, it looks like Admin canât see userâs chat preferences.
Iâve been exploring it a bit further this morning, and mine seem to be working okay.
I have 6 test users, all auto-enrolled members of the ~general channel. One is an admin, and one is a brand new TL0 user who has never opened the chat channel (or chat). None of them have logged in since yesterday (apart from the new test_six user, though I made sure they had at least 15 minutes of âdowntimeâ prior to testing).
Pinging the ~general channel with @all
sent them all a notification. Moments later 6 chat_summary
emails were sent out to their respective test email addresses.
Iâm not sure what else to check. Iâve had a dig around in the code, but my code-deciphering skills arenât great. Iâll have another think.
Thanks for mentioning that. Iâve raised it with the Team.
Thanks.
Without having much expertise myself, users_with_unprocessed_unread_mentions in lib/chat_mailer.rb does not seem to be pulling all the users to be emailed?
Would someone have a way to validate thisâŚ
@JammyDodger
Updated title to reflect the actual issue.
Any other tests you can suggest please?
Should I tag this a bug or would you see any other tests to recreate?
I donât think we have a clear reproduction yet.
My understanding is that @JammyDodger is trying to reproduce this issue based on your report, but has so far been unsuccessful.
A few notes:
To clarify, this is not a channel-wide setting, but a user preference for that channel. But what youâre showing are the defaults, so Iâd suspect that most of the 313 members have it set that way.
Are you sure they were away? If they were on the site, then the notification will not send an email.
OK, thatâs pretty strong evidence that something isnât working as expected here. I would have guessed that more than 2 out of 313 people would be away. Is is possible that they were all on the site at that time?
Thanks for the clarification. I had actually thought these were channel settings admin could change. Tbh, âSettingsâ sounds so much like an admin control.
Are you sure they were away? If they were on the site, then the notification will not send an email.
OK, thatâs pretty strong evidence that something isnât working as expected here. I would have guessed that more than 2 out of 313 people would be away. Is is possible that they were all on the site at that time?
Yes, it is safe to say the bulk of them (if not all) were away in the preceding 15 minutes (I wish we had that kind of engagement ). I picked a non-staff account that was away and checked too.
I think I have managed to replicate this.
I couldnât on my existing test site, but wondered if it was because I had already done/changed/tweaked something previously that may have affected it, so I spun up a new one and tried it on that.
everyone
to chat_allowed_groups
(alongside staff
)@all
@JammyDodger - Did you change the value of the chat allowed groups
setting? if itâs set to only staff
, that would explain why only the admin was emailed.
I enabled chat, and added everyone
at the same time. (sorry, I missed it out of the step-by-step. Iâll add it in now)
I think Iâve clocked it @Roman_Rizzi . If I add everyone
to chat_allowed_groups
, everyone gets to access chat and receive notifications, but doesnât get the @all
emails. However, if I add trust_level_0
then the non-staff test-users get emails about the @all
mentions.
Wow, what an investigation!
I checked and have staff, everyone in chat allowed groups on my site.
Thanks @JammyDodger
We need to handle the everyone
case differently because itâs not like other groups. I have a fix ready here:
discourse:main
â discourse:emails_for_everyone
The mailer in charge of sending chat summary emails applies a filter to ensure oâŚ
@alehandrof is reporting that some users are not getting email notifications for messages in a group chat:
Iâm trying out chat with specific people and folks are reporting that âI didnât receive any email letting me know that someone add a comment in chat, even I have the right setting for the email notification.â
The users say they have their preferences set to the default, and were not active recently:
And group direct messages have their âchannelâ setting default to receive notifications âFor all activityâ so notifications should not require a @mention.
On the other hand, Alex (admin) is receiving email notifications directly.
Alex, can you confirm which version your site is currently running?