Customs email headers and/or subjects tags

AI-generated summary

Customs Email Headers and/or Subjects Tags

A discussion about adding custom email headers or subject tags to automatically sort notification emails sent by Discourse. XioNoX suggests using custom headers similar to Bugzilla’s notification emails.

downey points out a related discussion on showing categories in email notifications. downey also mentions that a category-specific List-Id header is now available, and users can add custom headers using the email custom headers site setting.

llc1990 provides instructions on how to set custom email headers. However, mattdm and mattdm discover that formatting using %{optional_pm}%{optional_cat}%{topic_title} does not work in custom headers.

simon investigates the code and finds that the custom headers setting does not support template substitution. mattdm suggests that using the same templating as the email subject setting could make custom headers more useful.

Hi!

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

Thanks!

3개의 좋아요

See also our discussion at:

Where we’re hoping to get categories in a header. :smile:

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.

2개의 좋아요

커스텀 이메일 헤더를 어떻게 설정하는지 궁금하신 분들을 위해 방법을 안내드립니다.

  1. 설정 패널 >> 이메일로 이동하거나 아래 링크를 사용하세요.
    https://forums.example.com/admin/site_settings/category/email
    도메인 이름은 본인 도메인으로 교체해야 합니다.

  2. email custom headers를 검색하고 원하는 값을 설정하면 됩니다. 끝!

%{optional_pm}%{optional_cat}%{topic_title} 같은 형식 지정이 사용자 정의 헤더에 포함될 수 있나요?

1개의 좋아요

기록을 위해 말씀드리면, 방금 테스트해 봤는데, 답은: 아니요, 확장은 없습니다. 예를 들어 다음과 같은 결과를 얻습니다.

X-Tags: %{optional_tags}

1개의 좋아요

코드 어디에도 %{optional_tags} 같은 값이 email custom headers 사이트 설정에 추가된 헤더에 치환되는 부분이 보이지 않습니다. 제가 발견한 것은 커스텀 헤더 값을 설정하는 데 사용되는 이 메서드입니다:

이 메서드는 다음 위치에서 호출됩니다:

설정값이 의도된 대로 어떻게 사용되며, 커스텀 헤더에 어떤 값이 치환될 수 있는지 Discourse 팀에서 좀 더 자세한 정보를 얻어보겠습니다.

@simon 비교

을

과 비교해 보세요.

템플릿과 email_subject 설정 사이의 관계에 대해 완전히 이해하지 못하는 부분이 있습니다. 템플릿이 존재하는 경우 email_subject가 사용되지 않는 것처럼 보이지만, 템플릿이 없는 경우가 언제인지 정확히 알지 못합니다. 이 부분을 제외하면, 커스텀 헤더를 생성하는 함수가 동일한 템플릿 처리 방식을 사용한다면 이 방식이 작동할 것이며, 커스텀 헤더에 유용한 동적 정보를 포함할 수 있을 것입니다.

2개의 좋아요