mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FIX: use metadata to hold the message_id with sparkpost
This commit is contained in:
parent
407cda1dfe
commit
71f940d478
3 changed files with 7 additions and 3 deletions
|
@ -133,12 +133,14 @@ module Email
|
|||
@message.header['X-Discourse-Post-Id'] = nil if post_id.present?
|
||||
@message.header['X-Discourse-Reply-Key'] = nil if reply_key.present?
|
||||
|
||||
# pass the original message_id when using mailjet/mandrill
|
||||
# pass the original message_id when using mailjet/mandrill/sparkpost
|
||||
case ActionMailer::Base.smtp_settings[:address]
|
||||
when /\.mailjet\.com/
|
||||
@message.header['X-MJ-CustomID'] = @message.message_id
|
||||
when "smtp.mandrillapp.com"
|
||||
@message.header['X-MC-Metadata'] = { message_id: @message.message_id }.to_json
|
||||
when "smtp.sparkpostmail.com"
|
||||
@message.header['X-MSYS-API'] = { metadata: { message_id: @message.message_id } }.to_json
|
||||
end
|
||||
|
||||
# Suppress images from short emails
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue