Page MenuHomePhabricator

Phabricator HTML emails have unclickable URLs in Thunderbird
Closed, ResolvedPublic

Description

Cloned from https://phabricator.wikimedia.org/T681:

I have switched my email preference to have emails HTML formatted, unfortunately the URL to the task is not enclosed in <a> element which make them unclickable.

The mail shows as:

TASK DETAIL
https://phabricator.wikimedia.org/T583

Associated HTML:

<div style="font-weight:800;">TASK DETAIL</div><div>https://phabricator.wikimedia.org/T583</div><br /

I would expect the URL to be enclosed in a <a> element.

Event Timeline

qgil raised the priority of this task from to Needs Triage.
qgil updated the task description. (Show Details)
qgil added a project: Phabricator.
qgil added a subscriber: qgil.
chad added subscribers: talshiri, chad.

Every client I tested, it is clickable, though it is missing the anchor tag. What email client are you using?

Thunderbird 31.2.0 (latest)

It would auto link detected URL in plain text messages, but not in HTML messages.

Under display I made sure Thunderbird uses the original HTML.

I have enabled HTML emails notification on this Phabricator instance and my previous comment generated an email containing the following HTML (I have inserted a few new lines for clarity)

<div>hashar added a comment.</div><br />
<div>Thunderbird 31.2.0 (latest)<br /><br />
It would auto link detected URL in plain text messages, but not in HTML messages.<br />
<br />
Under display I made sure Thunderbird uses the original HTML.</div><br />
<div style="font-weight:800;">TASK DETAIL</div><div>https://secure.phabricator.com/T6343</div><br />
<div style="font-weight:800;">REPLY HANDLER ACTIONS</div>
<div>Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign &lt;username&gt;.</div><br />

So I guess it is all about slightly adjusting the link from:

<div>https://secure.phabricator.com/T6343</div><br />

To:

<div><a href="https://secure.phabricator.com/T6343">https://secure.phabricator.com/T6343</a></div><br />
chad renamed this task from Phabricator HTML emails have unclickable URLs to Phabricator HTML emails have unclickable URLs in Thunderbird.Oct 17 2014, 11:06 PM
chad triaged this task as Normal priority.

Thanks for the report!

Thank you for the triaging and initial investigation!

PhabricatorMetaMTAMailBody is used to build bodies. Currently, links are (usually? always?) added with addTextSection(). To fix this:

  • Add a new addLinkSection($header, $link) method to PhabricatorMetaMTAMailBody.
    • This method should call addPlaintextSection($header, $link) for the text part, to preserve plaintext behavior.
    • However, it should build an <a ...> tag from the link, and then call addHTMLSection($header, $new_link_tag), instead of just adding a normal block of text to the HTML body. This might need a <div> around it too.
  • Then, find callsites where addTextSection($header, $link) is used to add a link, and replace them with addLinkSection($header, $link).

(And, yeah, most clients don't seem to care that we don't actually have an <a ..> tag and just link the thing anyway.)

That is a nice jump! I guess it represents D10762 about to land 8-)

That is confirmed to work on Wikimedia installation. Thank you very much!