From 41155441c9412ab0dba0b62f606cdef5488343f1 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sat, 21 Oct 2023 17:23:03 -0400 Subject: Reduce emails from quote submission If I'm the submitter, it won't send the pending email. It still needs to be moderated though. --- app/controllers/quotes_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/controllers/quotes_controller.rb') diff --git a/app/controllers/quotes_controller.rb b/app/controllers/quotes_controller.rb index dd37cde..a0aa7cd 100644 --- a/app/controllers/quotes_controller.rb +++ b/app/controllers/quotes_controller.rb @@ -180,7 +180,10 @@ class QuotesController < ApplicationController @quote.state = :pending @quote.save! - QuoteMailer.with(quote: @quote).pending_quote_email.deliver_later + # hacky little thing to reduce the number of emails I get + unless @quote.submitter == "hatkirby" + QuoteMailer.with(quote: @quote).pending_quote_email.deliver_later + end flash[:notice] = "Your quote has been submitted and is pending moderation." respond_to do |format| -- cgit 1.4.1