# Restore Mailing List Mode Daily Summary

**URL:** https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761
**Category:** Plugin
**Created:** [6월 19, 2017, 5:47오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761 "2017-06-19T17:47:36Z")
**Posts on this page:** 20
**Page:** 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: [6월 19, 2017, 5: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

```

---

<div class="post-metadata">

### Author: ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)
#### Post date: [12월 6, 2017, 10:38오전 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/2 "2017-12-06T10:38:30Z")

</div>

@joebuhlig This started spitting errors since v1.9.0.beta15, see:

[https://meta.discourse.org/t/jobs-enqueuemlmdailysummary-spitting-errors/75504](https://meta.discourse.org/t/jobs-enqueuemlmdailysummary-spitting-errors/75504)

---

<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: [12월 6, 2017, 2:51오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/3 "2017-12-06T14:51:45Z")

</div>

Looks like an issue that likely started about a month ago and is due to this commit:

[https://github.com/discourse/discourse/commit/1f14350220b4df9ee0bdc3c6bf1e7794b7c494fc#diff-4676c008b11a5480d73d4a6de01e45b9](https://github.com/discourse/discourse/commit/1f14350220b4df9ee0bdc3c6bf1e7794b7c494fc#diff-4676c008b11a5480d73d4a6de01e45b9)

So as a result:

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

---

<div class="post-metadata">

### Author: ![JagWaugh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagwaugh/32/69335_2.png) [@JagWaugh](https://meta.discourse.org/u/JagWaugh)
#### Post date: [12월 6, 2017, 3:26오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/4 "2017-12-06T15:26:24Z")

</div>

Thanks Joe,

I have updated the Plugin on our sandbox, no more error messages there (I manually triggered the sidekiq job).

---

<div class="post-metadata">

### Author: ![hdf\_mneedham](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hdf\_mneedham](https://meta.discourse.org/u/hdf_mneedham)
#### Post date: [2월 13, 2018, 4:25오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/5 "2018-02-13T16:25:37Z")

</div>

Is there any way I could change the words summaries and summary to digests and digest? Like many other interested in this, I’m migrating a mailing list, and my users are accustomed to “digest”. I think there’s too much potential for confusions with the builtin “actvity summary” and this plugin’s “daily summary”.

Thanks!

---

<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: [2월 13, 2018, 5:07오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/6 "2018-02-13T17:07:42Z")

</div>

> [@hdf\_mneedham](#):
>
> Is there any way I could change the words summaries and summary to digests and digest?

You can! Go to Admin → Customize → Text Content. From there you can search for the strings you [find in the locales](https://github.com/joebuhlig/discourse-mlm-daily-summary/tree/master/config/locales) and make changes to them from there.

---

<div class="post-metadata">

### Author: ![hdf\_mneedham](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hdf\_mneedham](https://meta.discourse.org/u/hdf_mneedham)
#### Post date: [2월 13, 2018, 9:00오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/7 "2018-02-13T21:00:19Z")

</div>

Excellent, thanks! I had no idea plugin text could be changed in this way.

Discourse is surprisingly messy with the wordings here. Besides this, I noticed that "digest is still used in the bootstrap message, and in Admin → Email → Preview DIGEST. Makes me wonder how many orphaned artifacts are still floating around.

---

<div class="post-metadata">

### Author: ![hdf\_mneedham](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hdf\_mneedham](https://meta.discourse.org/u/hdf_mneedham)
#### Post date: [2월 14, 2018, 2:35오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/8 "2018-02-14T14:35:55Z")

</div>

The discussion and screenshots I’ve seen of this feature when it was builtin was that the daily digest was a sub-option of mailing list mode, in the dropdown. Now it’s a separate options, visually at the same level as, and unrelated to mailing mist mode, but the name still says mailing list mode. Does the MLM checkbox and dropdown affect the daily digest? Yesterday I installed the plugin on my test instance and enabled digest mode for my account, but did not enable MLM. No digest has been received.

Out of curiosity, Was this a deliberate change, a side-effect of moving from builtin to plugin functionality, or something else?

---

<div class="post-metadata">

### Author: ![hdf\_mneedham](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hdf\_mneedham](https://meta.discourse.org/u/hdf_mneedham)
#### Post date: [2월 14, 2018, 5:41오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/9 "2018-02-14T17:41:11Z")

</div>

I’m planning to create/activate accounts for me users, and enable daily summary for whomever mailman digest had been enabled. Since there are new accounts, I don’t have any prior values in Discourse to check, so I’m planning to set feed it a list of user\_ids.

Edit: I’m not sure why I had problems earlier, but for the record, it appears that either of the following will work:

`foo.custom_fields["user_mlm_daily_summary_enabled"] = true`

`UserCustomField.find_or_create_by(user_id: <USER_ID>, name: "user_mlm_daily_summary_enabled").update(value: "true")`

The second one requires me to look up \<USER\_ID\>, but besides this extra step, is there any advantage to using one over the other?

Thanks.

---

<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: [2월 14, 2018, 9:22오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/10 "2018-02-14T21:22:01Z")

</div>

> [@hdf\_mneedham](#):
>
> Yesterday I installed the plugin on my test instance and enabled digest mode for my account, but did not enable MLM. No digest has been received.

It’s been a while, but I believe they are independent settings. I do know you would need to wait 24 hours as it checks every hour but only sends out to users who joined the site at that hour of the day. Does that make sense? It’s designed to prevent an overload of emails going out from the server at once.

> [@hdf\_mneedham](#):
>
> Out of curiosity, Was this a deliberate change, a side-effect of moving from builtin to plugin functionality, or something else?

Side effect. You could likely get it to work as a single setting but it would require consistent maintenance to make sure it doesn’t break with new versions of Discourse. And that’s the opposite of what I want in the plugins I build. I do a fair amount of extra work on these to make sure they’re as future proof as possible.

---

<div class="post-metadata">

### Author: ![hdf\_mneedham](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hdf\_mneedham](https://meta.discourse.org/u/hdf_mneedham)
#### Post date: [2월 15, 2018, 4:41오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/11 "2018-02-15T16:41:17Z")

</div>

> [@joebuhlig](#):
>
> I do know you would need to wait 24 hours as it checks every hour but only sends out to users who joined the site at that hour of the day. Does that make sense? It’s designed to prevent an overload of emails going out from the server at once.

It makes sense, but it makes it a little hard to predict when the message should arrive.

After waiting another day, it seems clear that no digest messages are being sent. I have accounts with only MLM enabled, ones with MLM and digests enabled, and ones with only digest enabled. I _am_ receiving activity summary emails, and MLM every-comment emails, but not “daily summary” emails. For some accounts the GUI was used, and for others the rails console. Any suggestions on how to troubleshoot where the problem might be?

---

<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: [2월 16, 2018, 2:26오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/12 "2018-02-16T14:26:47Z")

</div>

Do you have anything in the logs or is it simply not showing up? I’m getting these from a couple sites that are running the plugin currently.

---

<div class="post-metadata">

### Author: ![hdf\_mneedham](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hdf\_mneedham](https://meta.discourse.org/u/hdf_mneedham)
#### Post date: [2월 16, 2018, 4:16오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/13 "2018-02-16T16:16:00Z")

</div>

I’m not finding anything in the logs, but maybe I’m not looking in the right place? Within the GUI (Admin → Logs), I don’t see anything relevant. Same with viewing the contents of /var/discourse/shared/standalone/log/rails/production.log. Under Admin → Email → Sent, I do see messages with email type “digest”, but they appear to be the builtin activity summary, as they are sent to every inactive account and not exclusively to (or even inclusively to) accounts that have daily summaries enabled. We’re using Amazon SES for SMTP, and there haven’t been any notifications for bounces or complaints. I just enabled delivery notifications, so within a day I’ll be able to check for positive delivery.

Is there somewhere else I could be checking?

---

<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: [2월 16, 2018, 5:40오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/14 "2018-02-16T17:40:59Z")

</div>

I’m specifically referring to /logs. But I would expect to see some form of email log that shows them being sent.

---

<div class="post-metadata">

### Author: ![hdf\_mneedham](https://avatars.discourse-cdn.com/v4/letter/h/f07891/32.png) [@hdf\_mneedham](https://meta.discourse.org/u/hdf_mneedham)
#### Post date: [2월 16, 2018, 6:22오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/15 "2018-02-16T18:22:26Z")

</div>

Out of the six entries in /logs, only two aren’t about image optimization. One is `Job exception: Validation failed: Badge has already been taken`, and the other is `Uncaught TypeError: Cannot read property 'show' of undefined Url: https://testforum.example.com/assets/plugin-third-party-7836e591aab88af977dd1de635258536ee999055ba534a632c4b2fe8983b90b7.js`. Neither seems relevant to me, but I can add more details if that would be helpful.

---

<div class="post-metadata">

### Author: ![etienne](https://avatars.discourse-cdn.com/v4/letter/e/9fc348/32.png) [@etienne](https://meta.discourse.org/u/etienne)
#### Post date: [9월 14, 2018, 9:49오전 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/16 "2018-09-14T09:49:45Z")

</div>

we where happily running discourse with discourse-mlm-daily-summary and loved that this feature came back throught the plug-in. thanks. but:

since version 2.05 of Discourse we are running into a problem with changing the user-settings for mlm-daily-summary. users cant enable/disable the daily summary. it stays on whatever value it has. it was posted on github here: [Unable to enable/disable "Enable daily summaries" per UI or by using API request · Issue #1 · procourse/discourse-mlm-daily-summary · GitHub](https://github.com/joebuhlig/discourse-mlm-daily-summary/issues/1)

has anyone an idea on how to solve this?  
it is essential to our concept of using discourse!

thanks in advance,  
etienne

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [9월 14, 2018, 7:17오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/17 "2018-09-14T19:17:55Z")

</div>

Aha @david probably this needs an update to whitelist the writeable user setting?

---

<div class="post-metadata">

### Author: ![etienne](https://avatars.discourse-cdn.com/v4/letter/e/9fc348/32.png) [@etienne](https://meta.discourse.org/u/etienne)
#### Post date: [9월 14, 2018, 8:27오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/19 "2018-09-14T20:27:06Z")

</div>

thanks for your idea.

if this is the point - @joebuhlig @david - who could do this update, so we could keep this feature part of our installation here at [http://forum.esbz.org](http://forum.esbz.org)?

thanks, etienne

---

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [9월 14, 2018, 9:14오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/20 "2018-09-14T21:14:17Z")

</div>

It’s @joebuhlig’s plugin, so he will need to need to make the final change. I have made a pull request here: [FIX: Make custom\_field editable by users by davidtaylorhq · Pull Request #2 · procourse/discourse-mlm-daily-summary · GitHub](https://github.com/joebuhlig/discourse-mlm-daily-summary/pull/2)

---

<div class="post-metadata">

### Author: ![etienne](https://avatars.discourse-cdn.com/v4/letter/e/9fc348/32.png) [@etienne](https://meta.discourse.org/u/etienne)
#### Post date: [9월 14, 2018, 11:15오후 UTC](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761/21 "2018-09-14T23:15:26Z")

</div>

thanks a lot @david.  
@joebuhlig: would be great if you could finalize this change.  
looking forward - thanks, etienne

[다음 페이지](https://meta.discourse.org/t/restore-mailing-list-mode-daily-summary/64761.md?page=2)
