# Can't set Email Notifications for Chat in admin setting

**URL:** <https://meta.discourse.org/t/cant-set-email-notifications-for-chat-in-admin-setting/264156>\
**Category:** Feature\
**Tags:** notifications, chat\
**Created:** [May 7, 2023, 4:57pm UTC](https://meta.discourse.org/t/cant-set-email-notifications-for-chat-in-admin-setting/264156 "2023-05-07T16:57:23Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Overgrow](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/overgrow/32/478189_2.png) [@Overgrow](https://meta.discourse.org/u/Overgrow)\
**Post date:** [September 11, 2024, 12:26pm UTC](https://meta.discourse.org/t/cant-set-email-notifications-for-chat-in-admin-setting/264156/3 "2024-09-11T12:26:26Z")

</div>

I just needed to set the default email notifications (to `never`) for chat for everyone, because it seems like `when_away` is the default.

I’m sharing the script:

```ruby
User.all.each do |user|
  user_option = user.user_option

  if user_option.chat_email_frequency != "never"
    puts "User: #{user.username} - Current chat_email_frequency setting: #{user_option.chat_email_frequency}"
    user_option.update(chat_email_frequency: "never")
    # puts "Updated chat_email_frequency setting to 'never' for user: #{user.username}"
  end
end

```

---

_[View the full topic](https://meta.discourse.org/t/cant-set-email-notifications-for-chat-in-admin-setting/264156)._
