From 8deb255593989931230a286afb27f62b263600f6 Mon Sep 17 00:00:00 2001 From: Developer <> Date: Tue, 23 Feb 2021 13:30:04 -0500 Subject: [PATCH] Added new email opt out for GabPRO reminders/introducing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Added: - new email opt out for GabPRO reminders/introducing --- app/controllers/settings/notifications_controller.rb | 2 +- app/controllers/settings/preferences_controller.rb | 2 +- app/models/user.rb | 4 ++++ app/views/settings/notifications/show.html.haml | 1 + config/locales/simple_form.en.yml | 1 + config/settings.yml | 1 + 6 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/controllers/settings/notifications_controller.rb b/app/controllers/settings/notifications_controller.rb index 6464c7eb..2c72b7ae 100644 --- a/app/controllers/settings/notifications_controller.rb +++ b/app/controllers/settings/notifications_controller.rb @@ -25,7 +25,7 @@ class Settings::NotificationsController < Settings::BaseController def user_settings_params params.require(:user).permit( - notification_emails: %i(follow follow_request reblog favourite mention digest report emails_from_gabcom), + notification_emails: %i(follow follow_request reblog favourite mention digest report pro_reminder emails_from_gabcom), interactions: %i(must_be_follower must_be_following must_be_following_dm) ) end diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb index 8491ad19..19afd9c0 100644 --- a/app/controllers/settings/preferences_controller.rb +++ b/app/controllers/settings/preferences_controller.rb @@ -47,7 +47,7 @@ class Settings::PreferencesController < Settings::BaseController :setting_hide_network, :setting_aggregate_reblogs, :setting_group_in_home_feed, - notification_emails: %i(follow follow_request reblog favourite mention digest report emails_from_gabcom), + notification_emails: %i(follow follow_request reblog favourite mention digest report pro_reminder emails_from_gabcom), interactions: %i(must_be_follower must_be_following) ) end diff --git a/app/models/user.rb b/app/models/user.rb index f2699776..958d2534 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -201,6 +201,10 @@ class User < ApplicationRecord settings.notification_emails['report'] end + def allows_pro_reminder_emails? + settings.notification_emails['pro_reminder'] + end + def hides_network? @hides_network ||= settings.hide_network end diff --git a/app/views/settings/notifications/show.html.haml b/app/views/settings/notifications/show.html.haml index e3539dac..a3d2fbe1 100644 --- a/app/views/settings/notifications/show.html.haml +++ b/app/views/settings/notifications/show.html.haml @@ -11,6 +11,7 @@ = ff.input :reblog, as: :boolean, wrapper: :with_label = ff.input :favourite, as: :boolean, wrapper: :with_label = ff.input :mention, as: :boolean, wrapper: :with_label + = ff.input :pro_reminder, as: :boolean, wrapper: :with_label = ff.input :emails_from_gabcom, as: :boolean, wrapper: :with_label - if current_user.staff? diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index 9ae5f8d2..db059341 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -133,6 +133,7 @@ en: reblog: Send e-mail when someone reposts your status report: Send e-mail when a new report is submitted emails_from_gabcom: Receive e-mail from Gab.com with announcements and other information + pro_reminder: Send e-mail regarding GabPRO membership 'no': 'No' required: mark: "*" diff --git a/config/settings.yml b/config/settings.yml index 5a46f6d9..96b2196a 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -35,6 +35,7 @@ defaults: &defaults digest: true report: true emails_from_gabcom: true + pro_reminder: true interactions: must_be_follower: false must_be_following: false