Problem/Motivation

In #3511206: Document how to add a custom header, for example MessageStream: broadcast for Postmark it was documented how to add a custom header, such as changing a custom "Broadcast" field from "Transactional" to "Broadcast"

However it would be awesome, also for less technically savvy users, if this could be set via the GUI.

Steps to reproduce

Want to add a custom header, but not sure how ...

Proposed resolution

Add support for custom headers under /admin/config/system/mailer/policy/, since other email services could make use of this feature as well.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ressa created an issue. See original summary.

adamps’s picture

A complication is that there are various different types of header with different data/parameters. See Symfony\Component\Mime\Header\Headers.

opi made their first commit to this issue’s fork.

opi’s picture

Backported MR from https://www.drupal.org/project/symfony_mailer/issues/3511206#comment-161...

Note that only text headers are supported. Maybe this Email Adjuster may be renamed "text header" instead of "custom header".

ressa changed the visibility of the branch 2.x to hidden.

ressa’s picture

Thanks @opi, should status here be "Needs review" as well?

opi’s picture

Status: Active » Needs review

indeed

adamps’s picture

Status: Needs review » Postponed

However it would be awesome, also for less technically savvy users, if this could be set via the GUI.

My concern is that these less technically savvy users don't necessarily know how to set headers correctly. A header is a part of the email that often isn't seen directly at UI level, but rather interpreted programmatically then displayed in a human-friendly format. It seems like a coding level concept rather than a UI one.

The feature could be used (accidentally or deliberately) to overwrite any of the standard headers, perhaps even in a way that has security implications. True, anyone with access to this UI page is already a trusted admin, but it doesn't mean they can't make a mistake, especially as they aren't technically savvy.

I feel this isn't something that belongs in the core module. Do you agree, do you see my point??

ressa’s picture

Thanks for your thoughtful answer, I really appreciate it. And I understand your concerns. But the way I see it, users can make mistakes or select wrong configuration all over the place. Users need to concentrate when they configure :)

I am myself less technically savvy coding-wise, who occasionally need to do something complex, like adding custom headers. But I have by now totally forgotten how the solution I documented works. I dread that something may change in a future version, and I got to deal with it then ...

And isn't it a good argument for custom headers, that the (I believe) fairly popular mail provider Postmark needs custom headers, so we should consider supporting it via the GUI?

opi’s picture

Even if I'm a developper (comfy with editing config files, etc) I would appreciate to edit configuration through the UI. Adding a simple header to fit Postmark needs is a very good example.