diff --git a/app/controllers/feedbacks_controller.rb b/app/controllers/feedbacks_controller.rb deleted file mode 100644 index 0de208a26b3f..000000000000 --- a/app/controllers/feedbacks_controller.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class FeedbacksController < ApplicationController - def new - @feedback = Feedback.new - end - - def create - @feedback = Feedback.new(params[:feedback]) - - # spam? will tell us if the hidden field was filled in (it shouldn't be filled in) - # valid? will tell us if the humanity test was answered correctly - if @feedback.spam? || !@feedback.valid? - flash[:alert] = - _("Our apologies but you failed the spam check. You could try contacting us on Github instead.") - render :new, status: :unprocessable_entity - else - @feedback.request = request - if @feedback.deliver - redirect_to root_path, - notice: _("Feedback sent! We will get back to you as soon as possible.") - else - flash[:alert] = - _("Could not send feedback. Did you pass the Humanity Test? Valid email? Try again?") - render :new, status: :unprocessable_entity - end - end - end -end diff --git a/app/models/feedback.rb b/app/models/feedback.rb deleted file mode 100644 index c1c84af90b9a..000000000000 --- a/app/models/feedback.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class Feedback < MailForm::Base - include MailForm::Delivery - append :remote_ip, :user_agent, :referrer - - attribute :name, validate: true - attribute :email, validate: /\A([\w.%+-]+)@([\w-]+\.)+(\w{2,})\z/i - attribute :message, validate: true - attribute :control, validate: /\A97\z/ - attributes :nickname, captcha: true - - # rubocop:disable Layout/LineLength - validates :message, format: {without: /\b(SEO|offer|ranking|rankings|transformative|engagement|click here|absolutely free|Money Back|affiliate|commission|marketing|promote)\b+/i, - message: "spam detected"} - # rubocop:enable Layout/LineLength - - # Declare the e-mail headers. It accepts anything the mail method - # in ActionMailer accepts. - def headers - { - :to => Settings.feedback.email, - :from => Settings.mail.mailer_sender, - :subject => "#{Settings.brand.title} Feedback", - :reply_to => email, - "X-PWPUSH-URL" => request.url - } - end -end diff --git a/app/views/feedbacks/new.html.erb b/app/views/feedbacks/new.html.erb deleted file mode 100644 index bef373749a0e..000000000000 --- a/app/views/feedbacks/new.html.erb +++ /dev/null @@ -1,43 +0,0 @@ -<% title(_('Send Feedback')) %> -
- <%= _('Tip: Copy your message to the clipboard in the unlikely chance submission fails.') %> -
- -