For a variety of reasons the option for mailing list mode users to receive a daily summary email was removed. It turns out there are a handful of communities that relied on this feature and as such it provoked a good discussion about the restoration of the feature. It was mentioned in that topic that I was working on this. Thanks to @lkramer and team for sponsoring this work!
This plugin adds an option to the email preferences for a user and allows them to enable the daily emails. It is NOT dependent on mailing list mode being turned on.
I should note that this essentially takes the code that was removed and wraps it up in plugin form. In the production scenario we’ve tested it in we even saw the email text/content customizations automatically pull in without extra work. The only change that was made was the addition of the standalone user preference.
Putting the code back in place is only part of the equation. It’s to be expected that admins will want to automatically turn this on for users that previously received the email. To do that you’ll need SSH access. Then you can follow these steps:
- Make sure you have a backup in place. Just to be safe.
- Enter the app and start a rails console.
cd /var/discourse ./launcher enter app rails c
- Run this command:
UserOption.where(mailing_list_mode: 'f', email_digests: 't', digest_after_minutes: 1440).pluck(:user_id).each do |id| UserCustomField.find_or_create_by(user_id: id, name: "user_mlm_daily_summary_enabled").update(value: "true") end
It was brought to my attention that the Daily Activity email should probably be turned off for these users as well. To do that, you’ll need to run this command as well, but only after the previous one:
UserCustomField.where(name: "user_mlm_daily_summary_enabled", value: "true").pluck(:user_id).each do |id| UserOption.find_by(user_id: id).update(email_digests: 'f') end