From 8b69a66380bbe32127e717ca2d79244392b7d2b6 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 9 Apr 2019 16:06:30 +0200 Subject: Add "why do you want to join" field to invite requests (#10524) * Add "why do you want to join" field to invite requests Fix #10512 * Remove unused translations * Fix broken registrations when no invite request text is submitted --- config/locales/simple_form.en.yml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'config/locales/simple_form.en.yml') diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index 3faaa6ac7..3317127f3 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -41,6 +41,8 @@ en: name: 'You might want to use one of these:' imports: data: CSV file exported from another Mastodon server + invite_request: + text: This will help us review your application sessions: otp: 'Enter the two-factor code generated by your phone app or use one of your recovery codes:' user: @@ -118,6 +120,8 @@ en: must_be_follower: Block notifications from non-followers must_be_following: Block notifications from people you don't follow must_be_following_dm: Block direct messages from people you don't follow + invite_request: + text: Why do you want to join? notification_emails: digest: Send digest e-mails favourite: Send e-mail when someone favourites your status -- cgit From 36b39fbac55a9b141b99b54f193ec2702f8c3c39 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 10 Apr 2019 00:35:49 +0200 Subject: Add preference to disable e-mails about new pending accounts (#10529) --- app/controllers/settings/preferences_controller.rb | 2 +- app/models/user.rb | 6 +++++- app/views/settings/notifications/show.html.haml | 1 + config/locales/simple_form.en.yml | 1 + config/settings.yml | 1 + 5 files changed, 9 insertions(+), 2 deletions(-) (limited to 'config/locales/simple_form.en.yml') diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb index 90967635d..5afdf0eec 100644 --- a/app/controllers/settings/preferences_controller.rb +++ b/app/controllers/settings/preferences_controller.rb @@ -49,7 +49,7 @@ class Settings::PreferencesController < Settings::BaseController :setting_hide_network, :setting_aggregate_reblogs, :setting_show_application, - notification_emails: %i(follow follow_request reblog favourite mention digest report), + notification_emails: %i(follow follow_request reblog favourite mention digest report pending_account), interactions: %i(must_be_follower must_be_following) ) end diff --git a/app/models/user.rb b/app/models/user.rb index c9309bc21..135baae12 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -191,6 +191,10 @@ class User < ApplicationRecord settings.notification_emails['report'] end + def allows_pending_account_emails? + settings.notification_emails['pending_account'] + end + def hides_network? @hides_network ||= settings.hide_network end @@ -295,7 +299,7 @@ class User < ApplicationRecord def notify_staff_about_pending_account! User.staff.includes(:account).each do |u| - next unless u.allows_report_emails? + next unless u.allows_pending_account_emails? AdminMailer.new_pending_account(u.account, self).deliver_later end end diff --git a/app/views/settings/notifications/show.html.haml b/app/views/settings/notifications/show.html.haml index 8aaac043b..6ec57b502 100644 --- a/app/views/settings/notifications/show.html.haml +++ b/app/views/settings/notifications/show.html.haml @@ -14,6 +14,7 @@ - if current_user.staff? = ff.input :report, as: :boolean, wrapper: :with_label + = ff.input :pending_account, as: :boolean, wrapper: :with_label .fields-group = f.simple_fields_for :notification_emails, hash_to_object(current_user.settings.notification_emails) do |ff| diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index 3317127f3..1a43e19e2 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -128,6 +128,7 @@ en: follow: Send e-mail when someone follows you follow_request: Send e-mail when someone requests to follow you mention: Send e-mail when someone mentions you + pending_account: Send e-mail when a new account needs review reblog: Send e-mail when someone boosts your status report: Send e-mail when a new report is submitted 'no': 'No' diff --git a/config/settings.yml b/config/settings.yml index 4f05519a5..63f7c3380 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -39,6 +39,7 @@ defaults: &defaults follow_request: true digest: true report: true + pending_account: true interactions: must_be_follower: false must_be_following: false -- cgit