To be able to sort automatically notification emails sent by Discourse, it would be great if they could have customs headers (or a subject tag) based on the message’s content/content:
For example, here is a list of headers Bugzilla sends with each notification email:
X-Bugzilla-Reason: CC AssignedTo
X-Bugzilla-Type: dep_changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Classification: Other
X-Bugzilla-ID: 1014331
X-Bugzilla-Product: mozilla.org
X-Bugzilla-Component: Server Operations
X-Bugzilla-Version: other
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: foobar@email.com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: –
X-Bugzilla-Assigned-To: email@email.com
X-Bugzilla-Target-Milestone: —
X-Bugzilla-Flags:
X-Bugzilla-OS: Linux
X-Bugzilla-Changed-Fields: Status Resolution
X-Bugzilla-Changed-Field-Names: bug_status resolution
FYI, there is now a category-specific List-Id header sent along with unsubscribe headers, and the ability to add your own generic headers for all notifications with the email custom headers site setting.
لأولئك الذين يتساءلون عن كيفية تعيين رأس البريد الإلكتروني المخصص، إليك الخطوات.
انتقل إلى لوحة الإعدادات > البريد الإلكتروني أو استخدم الرابط أدناه https://forums.example.com/admin/site_settings/category/email، ويجب عليك استبدال اسم النطاق باسم نطاقك.
ابحث عن email custom headers، ثم قم بتعيين القيم الخاصة بك. هذا كل شيء!
لا أرى في أي مكان في الكود شيئًا مثل %{optional_tags} سيتم استبداله في ترويسة تمت إضافتها إلى إعداد الموقع email custom headers. ما أجده هو هذه الطريقة المستخدمة لتعيين قيمة الترويسات المخصصة:
يتم استدعاؤها من:
سأحاول الحصول على مزيد من التفاصيل من فريق Discourse حول كيفية استخدام الإعداد المقصود وما هي القيم التي يمكن استبدالها في الترويسات المخصصة.
هناك بعض التعقيد مع القوالب مقابل إعداد email_subject الذي لا أفهمه تمامًا - يبدو أن الأخير لا يُستخدم إذا كان هناك قالب، ولكني لست متأكدًا من متى لا يكون هناك قالب! ولكن بصرف النظر عن ذلك، فإن الشيء الأساسي هو أنه إذا كانت الوظيفة التي بنت الرؤوس المخصصة تستخدم نفس القوالب، فسيعمل هذا ويمكن أن تحتوي الرؤوس المخصصة على معلومات ديناميكية مفيدة.