Users not notified by email of private messages

(Paul Apostolos) #1

All of our users have the checkbox Receive an email when someone sends you a private message checked. However, when they are sent private messages, they are never notified via email.

Nothing in Sidekiq and no errors in the logs.

I tried it on two different installs. Has anyone else experienced this?

(Jeff Atwood) #2

Are these users online? (We suppress notifications for users that are seen as “online” to Discourse).

What do the email logs say in /admin/email/skipped ?

(Paul Apostolos) #3

No, the users were not online and nothing shows up in the Skipped section of the logs.

(Jeff Atwood) #4

Anything unusual about the configuration on those two sites? SSO? How are the PMs generated, through the web interface?

You could test with a brand new vanilla install of Discourse, but I suspect it will work fine.

Any ideas @sam?

(Paul Apostolos) #5

The sites are using SSO…But, the private messages are generated using the web interface. I click on the user’s avatar which takes me to their profile. From there, I click the big blue Private Message button to create the message.

I’ll stand up a vanilla instance this weekend and see what I can figure out.

Any ideas where to start debugging in the code? A PM is just a post, right, so it should follow that workflow for notifications?

(Jeff Atwood) #6

My gut feeling is that something in SSO is causing a bug here. PMs definitely should generate notifications to the user, and email notifications if they are not active on the site. All this works out of the box.

(Paul Apostolos) #7

The notifications are created and added to the notifications table, But I can’t see anywhere that an email is created (or even attempted to be created) for the notification.

So, the notification is created but the email job is never enqueued.

(Jeff Atwood) #8

Hmm is this a sidekiq blockage @sam? You said you thought it might be a
rails connection pooling bug.

(Sam Saffron) #9

No I don’t think so, I think there is an issue with SSO. debugging it.I suspect accounts are not activated properly.

(Allen - Watchman Monitoring) #10

Our users are invited into our Discourse, I want to do anything we can to help them get back there.

One of the best ways I can think of is to have the welcome email hit their inbox.

How can this behaviour be changed, so that the welcome message is there for them to refer back to later on when they aren’t logged in?

(Michael - #11

I’m investigating a similar thing. What strikes me is that the code only seems to send an email when both email_direct and email_private_messages are set ? Is this really the desired behaviour? Or am I misunderstanding the code here?

Urgent: help troubleshoot missing notifications for watched categories
(Jeff Atwood) #12

If someone is added to a PM their tracking state is often set to Tracked instead of Watched which makes it almost impossible to see. But for regular PMs to one person I have never seen it not work.

(Michael - #13

I have, I can reproduce users not getting a PM email notification if email_direct is not set - and that behaves exactly like what is in the source code.

Let me turn the question around: do you know why is there a check for email_direct in the enqueue_private function, and not just for email_private_messages ? This code is almost two years old and I can’t imagine that this is a bug, but I can repro this and it just doesn’t make sense… :fearful:

(Jeff Atwood) #14

Don’t know, @eviltrout would have to look. But we used PMs as a mechanism for job interviews here recently and I am quite confident that was working, e.g. those users were being emailed…

(Robin Ward) #15

It certainly seems odd that email_direct is required for PMs. I can’t offer an explanation for that, but accounts default to that being true so unless users turned it off they should receive PMs.

(Jeff Atwood) #16

Ok @techapj can you correct this? It does seem that it should only check the one boolean there. Check it in as FIX: so we can backport.

(Arpit Jalan) #17

Okay, done: