# Restore Mailing List Mode Daily Summary

**URL:** <https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761>\
**Category:** Plugin\
**Created:** [2017年六月19日 17:47 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761 "2017-06-19T17:47:36Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)\
**Post date:** [2017年六月19日 17:47 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/1 "2017-06-19T17:47:36Z")

</div>

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](https://meta.discourse.org/t/please-restore-email-digests/63895). It was mentioned in that topic that I was working on this. Thanks to @lkramer and team for sponsoring this work! 🎉

[https://github.com/joebuhlig/discourse-mlm-daily-summary](https://github.com/joebuhlig/discourse-mlm-daily-summary)

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](https://github.com/discourse/discourse/commit/71a266b6731368f463858269ca5856ad934bbf34) 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:

1. Make sure you have a backup in place. Just to be safe.
2. Enter the app and start a rails console.

```plaintext
cd /var/discourse
./launcher enter app 
rails c

```

3. Run this command:

```plaintext
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

```

EDIT:

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:

```plaintext
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

```

---

_[View the full topic](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761)._
