# Digest email frequency not updating for existing users?

**URL:** https://meta.discourse.org/t/digest-email-frequency-not-updating-for-existing-users/92045
**Category:** Support
**Tags:** activity-summary
**Created:** [11 juli 2018 om 03:06 UTC](https://meta.discourse.org/t/digest-email-frequency-not-updating-for-existing-users/92045 "2018-07-11T03:06:39Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![All\_Might](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@All\_Might](https://meta.discourse.org/u/All_Might)
#### Post date: [11 juli 2018 om 03:06 UTC](https://meta.discourse.org/t/digest-email-frequency-not-updating-for-existing-users/92045/1 "2018-07-11T03:06:39Z")

</div>

Hey guys so we recently set up our Discourse community and migrated over users from Xenforo.

It seems like when we migrated users over, the digest frequency was set to daily. I’ve since set it to weekly (our desired behavior).

When I click into the preferences of a new member I see their “Activity Summary” preference is set to weekly (matching the admin-set digest frequency). Perfect!

However when I click into the preferences of an older existing member I see their “Activity Summary” preference **is still set to daily.**

Result: our older existing members are getting summary emails for _each day_ they don’t visit and are getting annoyed.

I know that users can change this individually in their own preferences, but **how can we make the weekly digest frequency setting in the admin panel apply to _all_ of our member’s “Activity Summary” preference, and not just new ones?**

How do we update the Activity Summary (digest) settings for all existing members?

---

<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: [11 juli 2018 om 03:09 UTC](https://meta.discourse.org/t/digest-email-frequency-not-updating-for-existing-users/92045/2 "2018-07-11T03:09:23Z")

</div>

You need to run a query at the rails command line to update the preference for all existing users.

I’m kind of unclear how you ended up with this setting, as daily is NOT the default in Discourse. There is bootstrap mode, where the first 50 users after initial install get a daily digest, but it turns off after that, and also sets everyone back to weekly (the default).

---

<div class="post-metadata">

### Author: ![All\_Might](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@All\_Might](https://meta.discourse.org/u/All_Might)
#### Post date: [11 juli 2018 om 03:17 UTC](https://meta.discourse.org/t/digest-email-frequency-not-updating-for-existing-users/92045/3 "2018-07-11T03:17:17Z")

</div>

Yep I remember the bootstrap mode! We did the transfer while still in bootstrap mode by following this guide:

> [@Migrate a XenForo forum to Discourse](https://meta.discourse.org/t/importing-xenforo-to-discourse/45232):
>
> Hey guys so after trying for a week or so I decided to import the database on docker app which I hoped it will succeed without any issues. TBH I got some issues at first but it turned to be all easy to solve. Now I would recommend doing this only once before you deploy your production site, after importing everything take a Discourse backup, wipe everything out and install new Discourse instance then restore the imported db. Ok let’s begin: First lets backup your old database from your old …

Everything went smoothly and our 150ish members were available in Discourse, and the bootstrap mode notification/banner went away which I took to mean that Discourse recognized our 50th user sign up as part of the migration and disabled bootstrap mode.

But perhaps somehow something went wrong with the update of the automatic user preference back to weekly?

> [@codinghorror](#):
>
> You need to run a query at the rails command line to update the preference for all existing users.

Is this a good thread to learn how to do this or would you recommend a better thread to shine more light on preference updates through the rails command line? VV  
[https://meta.discourse.org/t/edit-a-user-setting-for-all-discourse-users/25162/2](https://meta.discourse.org/t/edit-a-user-setting-for-all-discourse-users/25162/2)

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [11 juli 2018 om 03:18 UTC](https://meta.discourse.org/t/digest-email-frequency-not-updating-for-existing-users/92045/4 "2018-07-11T03:18:02Z")

</div>

If the site is in bootstrap mode while doing the migration then all the imported users will have the daily digest as default. I experienced this in my last import.

---

<div class="post-metadata">

### Author: ![All\_Might](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@All\_Might](https://meta.discourse.org/u/All_Might)
#### Post date: [11 juli 2018 om 03:19 UTC](https://meta.discourse.org/t/digest-email-frequency-not-updating-for-existing-users/92045/5 "2018-07-11T03:19:38Z")

</div>

Do you remember the steps you took to fix this? Would greatly appreciate even a tiny bit of help and direction as I’m fairly new at a lot of this stuff!

---

<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: [11 juli 2018 om 03:26 UTC](https://meta.discourse.org/t/digest-email-frequency-not-updating-for-existing-users/92045/6 "2018-07-11T03:26:21Z")

</div>

Hmm we should fix this somehow, it is bad to end up with a migrated site of thousands of users that have daily digests. What do you think?

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [11 juli 2018 om 03:30 UTC](https://meta.discourse.org/t/digest-email-frequency-not-updating-for-existing-users/92045/7 "2018-07-11T03:30:01Z")

</div>

I agree. I can add it to my list.

@All_Might you should follow the above guide and execute the below command

`UserOption.update_all(digest_after_minutes: 10080)`

---

<div class="post-metadata">

### Author: ![All\_Might](https://avatars.discourse-cdn.com/v4/letter/a/f17d59/32.png) [@All\_Might](https://meta.discourse.org/u/All_Might)
#### Post date: [12 juli 2018 om 14:03 UTC](https://meta.discourse.org/t/digest-email-frequency-not-updating-for-existing-users/92045/8 "2018-07-12T14:03:22Z")

</div>

@codinghorror @vinothkannans Thanks a bunch guys that did the trick! I really appreciate the help 🙂

---

<div class="post-metadata">

### Author: ![robmc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmc/32/125900_2.png) [@robmc](https://meta.discourse.org/u/robmc)
#### Post date: [12 juli 2018 om 14:09 UTC](https://meta.discourse.org/t/digest-email-frequency-not-updating-for-existing-users/92045/9 "2018-07-12T14:09:49Z")

</div>

For future reference - if anyone uses this solution to fix a similar issue, it might be worth considering that if the site has been active for a while, some users MAY have changed their digest frequency or stopped it, so it would be useful to exclude those who have changed their settings already.

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [25 juli 2018 om 07:22 UTC](https://meta.discourse.org/t/digest-email-frequency-not-updating-for-existing-users/92045/10 "2018-07-25T07:22:14Z")

</div>

> [@codinghorror](#):
>
> we should fix this somehow, it is bad to end up with a migrated site of thousands of users that have daily digests.

I’ve fixed it here

[https://github.com/discourse/discourse/commit/1390eb2957b89f04adce0b92a8cca83f22c30a04](https://github.com/discourse/discourse/commit/1390eb2957b89f04adce0b92a8cca83f22c30a04)

---

<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: [25 juli 2018 om 07:23 UTC](https://meta.discourse.org/t/digest-email-frequency-not-updating-for-existing-users/92045/11 "2018-07-25T07:23:41Z")

</div>


