simon
8 يناير 2022، 1:03ص
7
لا أرى في أي مكان في الكود شيئًا مثل %{optional_tags} سيتم استبداله في ترويسة تمت إضافتها إلى إعداد الموقع email custom headers. ما أجده هو هذه الطريقة المستخدمة لتعيين قيمة الترويسات المخصصة:
!@stripped_secure_upload_shas.include?(optimized_1X&.sha1)
)
return
end
if (optimized_1X&.filesize || upload.filesize) >
SiteSetting.secure_uploads_max_email_embed_image_size_kb.kilobytes
return
end
true
end
#
# Two behaviors in the mail gem collide:
#
# 1. Attachments are added as extra parts at the top level,
# 2. When there are both text and html parts, the content type is set
# to 'multipart/alternative'.
#
# Since attachments aren't alternative renderings, for emails that contain
# attachments and both html and text parts, some coercing is necessary.
#
يتم استدعاؤها من:
# to the array of values for the header.
@message.header[key] = nil
@message.header[key] = our_value
end
value = header_value(key)
# Remove Auto-Submitted header for group private message emails, it does
# not make sense there and may hurt deliverability.
#
# From https://www.iana.org/assignments/auto-submitted-keywords/auto-submitted-keywords.xhtml:
#
# > Indicates that a message was generated by an automatic process, and is not a direct response to another message.
@message.header[key] = nil if key.downcase == "auto-submitted" && smtp_group_id
# Replace reply_key in custom headers or remove
if value&.include?("%{reply_key}")
# Delete old header first or else the same header will be added twice
@message.header[key] = nil
@message.header[key] = value.gsub!("%{reply_key}", reply_key) if reply_key.present?
end
سأحاول الحصول على مزيد من التفاصيل من فريق Discourse حول كيفية استخدام الإعداد المقصود وما هي القيم التي يمكن استبدالها في الترويسات المخصصة.