Summary emails, new users and SSO

My Discourse site is the SSO client of my Wordpress site. Discourse users have been created for members of the Wordpress site as they have logged into Wordpress. Almost no users have actually visited the forum. I have summary emails set to go out every day and retroactively applied the setting to all the existing Discourse users. The issue I am having is that it appears these summaries are only being sent to Discourse accounts that have actually visited the forum at some point. I want users to start getting the Summary Emails as soon as the account exists within Discourse. Is the behavior I am seeing with emails the default behavior and if so how can it be overcome?

Do you know if users are having to respond to a Discourse activation email before their first login from WordPress to Discourse? This will be the case if you are not using the default WordPress registration method on your WordPress site. What this means is that the users will not be marked as active on Discourse until they have responded to the email. The summary email is only sent to users who have been marked as active on Discourse.

1 Like

There is quite a bit of customization going on with our WordPress registration but all the users I check within Discourse are set to active. However, last emailed and seen are blank.

I wonder if there might be a bug? All my setting seem to be in place. The only thing I can think of is that I set “suppress digest email after days” to 3650 and because my users have never been seen their email is suppressed. I also had email suppressed for all users for a time but that is currently not set.

1 Like

I think that’s it. The summary email shows you the summary of stuff since you last visited. If you’ve never visited, there’s no “since you last visited.”

3 Likes

That seems to be the cause of the problem. The code is checking this:

.where("COALESCE(last_seen_at, '2010-01-01') >= CURRENT_TIMESTAMP - ('1 DAY'::INTERVAL * #{SiteSetting.suppress_digest_email_after_days})")

SInce last_seen_at will return nil for the new user, the code will check to see if ‘2010-01-01’ is greater than 3650 days ago before sending the email. Increasing the value of that setting should solve the issue for you. The risk with setting that value to a large number of days is that you may be sending the summary email to users who have no interest in the site.

3 Likes

It helped a little bit but did not solve the issue. To test things I set the Summary email frequency to 30 minutes and the maximum notifications per day to 1. I set the last seen setting to 365000. Basically users added to Discourse within the last 17 days received emails and a few users that have been seen recently but had been created earlier also received emails. I can confirm that all users are activated -or at least I can from a random selection of users that did not receive emails. Not sure how to fix this. Is there anything I can reset manually?

Did a little more digging and it seems that summary email preferences on most accounts are not being set when I change the frequency. So if I change the summary frequency from 30 minutes to 1 hour and confirm to make the change for all accounts -the setting does not seem to take. I confirmed this by impersonating accounts that do not get the emails. Their preference setting will have summaries turned off.

1 Like