修复:反馈意见发送邮件失败错误返回
This commit is contained in:
parent
f98886b3a0
commit
b56930b9ab
|
@ -25,7 +25,7 @@ class Admins::FeedbacksController < Admins::BaseController
|
|||
def create_history
|
||||
@feedback_message_history = @feedback.feedback_message_histories.new(feedback_message_history_params)
|
||||
@feedback_message_history.user = current_user
|
||||
if @feedback_message_history.save!
|
||||
if @feedback_message_history.save
|
||||
redirect_to admins_feedbacks_path
|
||||
flash[:success] = "发送通知成功"
|
||||
else
|
||||
|
|
|
@ -29,6 +29,8 @@ class FeedbackMessageHistory < ApplicationRecord
|
|||
unless UserMailer.feedback_email(feedback&.user&.mail, title, content).deliver_now
|
||||
errors[:title] << '邮件发送失败!'
|
||||
end
|
||||
rescue
|
||||
errors[:title] << '邮件发送失败!'
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -231,6 +231,8 @@ zh-CN:
|
|||
ignore:
|
||||
name: 'git忽略文件名称'
|
||||
content: 'git忽略文件内容'
|
||||
feedback_message_history:
|
||||
title: ''
|
||||
close_pr: 合并请求
|
||||
roles:
|
||||
Developer: 开发者
|
||||
|
|
Loading…
Reference in New Issue