Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the Content-Base hedaer to the default template #96

Merged
merged 2 commits into from
May 3, 2022
Merged

Add the Content-Base hedaer to the default template #96

merged 2 commits into from
May 3, 2022

Conversation

StayPirate
Copy link
Contributor

I figure out that this header is often used to highlight a direct link to the feed item by some MUA. Thunderbird is one of those.

A screenshot without the Content-Base header set:
image

A screenshot with the Content-Base header set:
image

N.B. Since I'm not a HTML expert, I'd like to hear some feedback about this change. Could this badly impact some emails? From its definition:

The Content-Base header provides a way for a server to specify a base URL for resolving URLs found in the entity body of a response.[5] The value of the Content-Base header is an absolute URL that can be used to resolve relative URLs found inside the entity.

I see this header might change how relative paths are resolved within the email's body.

This field is often used to provide a direct link to the feed item by
some MUA. Thunderbird is one of those which behaves like that.
@skx
Copy link
Owner

skx commented May 3, 2022

I don't see a problem with that change.

That said we already have code which is designed to convert relative links to absolute ones, which is here.

You might be describing a different thing - the behaviour of the mail client - but the actual content should already contain everything as absolute via the rewriting mentioned above.

Will look in more detail this evening, in the meantime thank-you for your contribution :)

@StayPirate
Copy link
Contributor Author

That said we already have code which is designed to convert relative links to absolute ones, which is here.

You might be describing a different thing - the behaviour of the mail client - but the actual content should already contain everything as absolute via the rewriting mentioned above.

Right, I'm only talking about how MUAs render emails. According to your statement, I now think that this PR should not introduce any weird behavior.

Will look in more detail this evening, in the meantime thank-you for your contribution :)

My pleasure, I consider this project a little treasure 👍🏼. So, thank you.

Do not add item's link to the body since it is shown in the rendered
headers.
@StayPirate
Copy link
Contributor Author

The latter commit removes the item's link within the email body (text and html).

This probably needs to be taken with a grain of salt because if the MUA (email client) does not intentionally show the Content-Base header content (see screenshot above), then the user may end up with no easy way to click the link.

I found this useful since I use Thunderbird, which in turn reports the link as the Content-Base header. I leave this commit here for @skx to choose if he wants it or not.

@skx
Copy link
Owner

skx commented May 3, 2022

Yeah removing the links would be a mistake for the MUAs that don't show the content of the Content-Base header.

I'll merge the header-change in, but not the second commit.

@skx skx merged commit b576a7a into skx:master May 3, 2022
@StayPirate StayPirate deleted the template_link branch May 4, 2022 08:05
@StayPirate StayPirate restored the template_link branch May 6, 2022 10:54
@StayPirate StayPirate deleted the template_link branch May 6, 2022 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants