mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 19:53:53 -06:00
DEBUG: Send all email processing errors to admins
This commit is contained in:
parent
d704991609
commit
a7a28454a1
@ -27,8 +27,10 @@ module Jobs
|
|||||||
message = Mail::Message.new(mail_string)
|
message = Mail::Message.new(mail_string)
|
||||||
client_message = RejectionMailer.send_trust_level(message.from, message.body)
|
client_message = RejectionMailer.send_trust_level(message.from, message.body)
|
||||||
Email::Sender.new(client_message, :email_reject_trust_level).send
|
Email::Sender.new(client_message, :email_reject_trust_level).send
|
||||||
rescue Email::Receiver::ProcessingError
|
rescue Email::Receiver::ProcessingError => e
|
||||||
# all other ProcessingErrors are ok to be dropped
|
# 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)
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
# inform admins about the error
|
# inform admins about the error
|
||||||
data = { limit_once_per: false, message_params: { source: mail, error: e }}
|
data = { limit_once_per: false, message_params: { source: mail, error: e }}
|
||||||
|
@ -4,7 +4,7 @@ class RejectionMailer < ActionMailer::Base
|
|||||||
include Email::BuildEmailHelper
|
include Email::BuildEmailHelper
|
||||||
|
|
||||||
def send_rejection(from, body)
|
def send_rejection(from, body)
|
||||||
build_email(from, template: 'email_reject_notification', from: from, body: body)
|
build_email(from, template: 'email_error_notification', from: from, body: body)
|
||||||
end
|
end
|
||||||
|
|
||||||
def send_trust_level(from, body, to)
|
def send_trust_level(from, body, to)
|
||||||
|
Loading…
Reference in New Issue
Block a user