From b1fb3cc44cd60464b1d0873b7745dd7098bac0d8 Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 8 Jan 2026 15:50:18 +0000 Subject: [PATCH] Fixed the issue of administrators not receiving emails. --- app/controllers/asks_controller.rb | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/app/controllers/asks_controller.rb b/app/controllers/asks_controller.rb index f9bfe77..c07a05c 100644 --- a/app/controllers/asks_controller.rb +++ b/app/controllers/asks_controller.rb @@ -599,24 +599,23 @@ class AsksController < ApplicationController "usage_rule" => @usage_rule } - unless manager_emails.empty? - template_data["bcc_recipients"] = manager_emails.join(',') - end + group_mail = email_er.mail + manager_emails = email_er.reviewer_emails + + all_recipients = ([group_mail] + manager_emails).flatten.compact.uniq email_er.email.update_attributes( :mail_lang=> site.default_locale, - :create_user=>(current_user rescue nil), - :mail_sentdate=>mail_sentdate, - :module_app=>@module_app, - :mail_to=>group_mail, - :mail_subject=>mail_subject, - :template=>'asks/email', - :template_data=>template_data, - :mail_reply_to => (manager_emails.empty? ? nil : manager_emails) + :mail_to=> all_recipients, + :mail_subject=> mail_subject, + :template=> 'asks/email', + :template_data=> template_data, + :mail_reply_to => (manager_emails.empty? ? nil : manager_emails) ) email_er.email.deliver end + def get_history question = AskQuestion.where(:serial_number => params["ticket_id"].to_i, :mail => params["email"]).first if !question.nil?