mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 01:17:36 +08:00
Merge pull request #4148 from tgxworld/dont_reply_to_emails_that_are_autogenerated
FIX: Don't send rejection mailer to bounced emails.
This commit is contained in:
@ -17,6 +17,9 @@ module Email
|
||||
class MessageBuilder
|
||||
attr_reader :template_args
|
||||
|
||||
REPLY_TO_AUTO_GENERATED_HEADER_KEY = "X-Discourse-Reply-to-Auto-Generated".freeze
|
||||
REPLY_TO_AUTO_GENERATED_HEADER_VALUE = "marked".freeze
|
||||
|
||||
def initialize(to, opts=nil)
|
||||
@to = to
|
||||
@opts = opts || {}
|
||||
@ -132,7 +135,11 @@ module Email
|
||||
def header_args
|
||||
result = {}
|
||||
if @opts[:add_unsubscribe_link]
|
||||
result['List-Unsubscribe'] = "<#{template_args[:user_preferences_url]}>" if @opts[:add_unsubscribe_link]
|
||||
result['List-Unsubscribe'] = "<#{template_args[:user_preferences_url]}>"
|
||||
end
|
||||
|
||||
if @opts[:mark_as_reply_to_auto_generated]
|
||||
result[REPLY_TO_AUTO_GENERATED_HEADER_KEY] = REPLY_TO_AUTO_GENERATED_HEADER_VALUE
|
||||
end
|
||||
|
||||
result['X-Discourse-Post-Id'] = @opts[:post_id].to_s if @opts[:post_id]
|
||||
|
Reference in New Issue
Block a user