mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FEATURE: webhooks support for mailgun
This commit is contained in:
parent
1caaf5208f
commit
116efffdaa
7 changed files with 129 additions and 4 deletions
|
@ -151,12 +151,12 @@ module Email
|
|||
|
||||
if @mail.error_status.present?
|
||||
if @mail.error_status.start_with?("4.")
|
||||
update_bounce_score(email_log.user.email, SOFT_BOUNCE_SCORE)
|
||||
Email::Receiver.update_bounce_score(email_log.user.email, SOFT_BOUNCE_SCORE)
|
||||
elsif @mail.error_status.start_with?("5.")
|
||||
update_bounce_score(email_log.user.email, HARD_BOUNCE_SCORE)
|
||||
Email::Receiver.update_bounce_score(email_log.user.email, HARD_BOUNCE_SCORE)
|
||||
end
|
||||
elsif is_auto_generated?
|
||||
update_bounce_score(email_log.user.email, HARD_BOUNCE_SCORE)
|
||||
Email::Receiver.update_bounce_score(email_log.user.email, HARD_BOUNCE_SCORE)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -168,7 +168,7 @@ module Email
|
|||
@verp ||= all_destinations.select { |to| to[/\+verp-\h{32}@/] }.first
|
||||
end
|
||||
|
||||
def update_bounce_score(email, score)
|
||||
def self.update_bounce_score(email, score)
|
||||
# only update bounce score once per day
|
||||
key = "bounce_score:#{email}:#{Date.today}"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue