diff --git a/app/controllers/admin/asks_controller.rb b/app/controllers/admin/asks_controller.rb index 3ef4fa9..34ea5b9 100644 --- a/app/controllers/admin/asks_controller.rb +++ b/app/controllers/admin/asks_controller.rb @@ -408,7 +408,9 @@ class Admin::AsksController < OrbitAdminController email_er.email_id = email.id email_er.save - @group_mail = email_er.mail + @group_mail = [] + @group_mail << email_er.mail + @group_mail = @group_mail + email_er.bcc_emails.split(",") @mail_sentdate = DateTime.now site = Site.first diff --git a/app/models/ask_question.rb b/app/models/ask_question.rb index 3f3f14a..ff121b3 100644 --- a/app/models/ask_question.rb +++ b/app/models/ask_question.rb @@ -20,6 +20,7 @@ class AskQuestion field :reply, type: String field :comment, type: String + field :bcc_emails, type: String field :situation, type: String, default: "is_email_not_confirmed" # 預設email未驗證 field :send_email, type: Integer, default: 0 field :email_id @@ -28,7 +29,7 @@ class AskQuestion field :agree_show, type: Boolean, default: false field :agree_usage, type: Boolean, default: false field :is_hidden, type: Boolean - + field :review_time, type: DateTime belongs_to :reviewer, class_name: "MemberProfile", foreign_key: :reviewer_id has_many :ask_status_histories @@ -109,7 +110,7 @@ class AskQuestion if changed? || @changed @new_history = AskStatusHistory.create( ask_question: self, - status: self.situation, + status: self.situation, comment: @release_comment, file: @release_file, user: @user diff --git a/app/views/admin/asks/_form.html.erb b/app/views/admin/asks/_form.html.erb index 3ddd517..dc18d1e 100644 --- a/app/views/admin/asks/_form.html.erb +++ b/app/views/admin/asks/_form.html.erb @@ -158,6 +158,12 @@ <%= f.text_area :reply, rows: 10, style: 'max-width: 500px; width: 100%;' %> +
+ <%= f.label :bcc_emails, class: "control-label muted" %> +
+ <%= f.text_area :bcc_emails, rows: 5, style: 'max-width: 500px; width: 100%;' %> +
+
diff --git a/config/locales/en.yml b/config/locales/en.yml index 2242bce..4a72039 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -119,6 +119,7 @@ en: exports: Export reply: Reply reply_success: Reply success + bcc_emails: BCC to: To widget: index: Form diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 3833a4b..2892b46 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -127,6 +127,7 @@ zh_tw: exports: 匯出 reply: 問題回覆 reply_success: 回覆成功 + bcc_emails: 郵件密件副本 to: 至 yes: 是 no: 否