+ <% end %>
<% text = @type=='digest' ? t('unsubscribe.submit') : t('unsubscribe.title') %>
diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml
index 151fd712cb3..8c3c14f0b6a 100644
--- a/config/locales/server.en.yml
+++ b/config/locales/server.en.yml
@@ -1028,6 +1028,7 @@ en:
submit: "Save preferences"
digest_frequency:
title: "You are receiving summary emails %{frequency}"
+ never_title: "You are not receiving summary emails"
select_title: "Set summary emails frequency to:"
never: "never"
diff --git a/spec/requests/email_controller_spec.rb b/spec/requests/email_controller_spec.rb
index e0764c6aeab..a0d0b4bb38d 100644
--- a/spec/requests/email_controller_spec.rb
+++ b/spec/requests/email_controller_spec.rb
@@ -191,6 +191,24 @@ RSpec.describe EmailController do
expect(response.body).to include(I18n.t("unsubscribe.different_user_description"))
end
+ it 'displays correct label when email_digests is set to false' do
+ user.user_option.update!(email_digests: false, digest_after_minutes: 10080)
+
+ navigate_to_unsubscribe
+
+ expect(body).to include("You are not receiving summary emails")
+ expect(body).to include("Don't send me any mail from Discourse")
+ end
+
+ it 'hides unsubscribe from all checkbox when user already unsubscribed' do
+ user.user_option.update!(email_digests: false, mailing_list_mode: false, email_level: 2, email_messages_level: 2)
+
+ navigate_to_unsubscribe
+
+ expect(body).to include("You are not receiving summary emails")
+ expect(body).not_to include("Don't send me any mail from Discourse")
+ end
+
it 'correctly handles mailing list mode' do
user.user_option.update_columns(mailing_list_mode: true)