mirror of
https://github.com/discourse/discourse.git
synced 2025-01-30 15:46:16 +08:00
Let's see if this works
This commit is contained in:
parent
94de396b99
commit
edc17dddb3
|
@ -28,6 +28,10 @@ module Jobs
|
|||
client_message = RejectionMailer.send_trust_level(message.from, message.body)
|
||||
Email::Sender.new(client_message, :email_reject_trust_level).send
|
||||
rescue Email::Receiver::ProcessingError => e
|
||||
Rails.logger.error e
|
||||
message = Mail::Message.new(mail_string)
|
||||
client_message = RejectionMailer.send_rejection(message.from, message.body, e.message)
|
||||
|
||||
# inform admins about the error
|
||||
data = { limit_once_per: false, message_params: { source: mail, error: e }}
|
||||
GroupMessage.create(Group[:admins].name, :email_error_notification, data)
|
||||
|
|
|
@ -3,11 +3,11 @@ require_dependency 'email/message_builder'
|
|||
class RejectionMailer < ActionMailer::Base
|
||||
include Email::BuildEmailHelper
|
||||
|
||||
def send_rejection(from, body)
|
||||
build_email(from, template: 'email_error_notification', from: from, body: body)
|
||||
def send_rejection(from, body, error)
|
||||
build_email(from, template: 'email_error_notification', error: "#{error.message}\n\n#{error.backtrace.join("\n")}", source: body)
|
||||
end
|
||||
|
||||
def send_trust_level(from, body, to)
|
||||
build_email(from, template: 'email_reject_trust_level', to: to)
|
||||
def send_trust_level(from, body)
|
||||
build_email(from, template: 'email_reject_trust_level')
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1306,6 +1306,10 @@ en:
|
|||
|
||||
`%{error}`
|
||||
|
||||
The original message follows.
|
||||
|
||||
---
|
||||
|
||||
%{source}
|
||||
|
||||
email_reject_trust_level:
|
||||
|
|
Loading…
Reference in New Issue
Block a user