Page MenuHomePhabricator

"Invite to topic" emails on Space don't display links to the topic or the site
Closed, ResolvedPublic


Emails generated by Discourse inviting a user to join a topic don't provide a link to the topic itself or to the site, and instead render embedded images as a link. The formatting is also significantly less aesthetically appealing than the other emails generated by the site.

[Wikimedia Space] qgil-WMF invited you to 'Success criteria for the Wikimedia Space prototype'.png (1×1 px, 301 KB)

Event Timeline

elappen-WMF added a subscriber: hdothiduc.

pinging @hdothiduc on this for thoughts before reporting upstream.

elappen-WMF renamed this task from "Invite to topic" emails on Space don't display necessary information to "Invite to topic" emails on Space don't display links to the topic or the site.Oct 16 2019, 4:15 PM
elappen-WMF moved this task from Backlog to Started on the Space (Oct-Dec-2019) board.

Mh that is weird and I would think that this is a bug on Discourse's end, because it's so unintuitive to not have a link there. I would report to/ask them.

I have done a little bit of digging...
This is the template for the Invited to topic email:

But more interestingly this is the text that substitutes %{message} in the above template:
(searched for "invited you to a discussion", just like what you have in the screenshot)

So, maybe adding something like %{topic_link} could be something you can test?

I have just sent invites to both of you from as the "canonical Discourse". If this is a bug in Discourse, I would expect it to be visible there.

Confirmed that the links do appear in Discourse Meta "invite to topic" emails, although the formatting is still not great.

invite to topic Discourse Meta.png (520×819 px, 49 KB)

I've tried to put in %{topic_link} but it's saying it's not a valid interpolation key.

Based on other templates (for example,, I also tried [%{site_name}](%{base_url}) to get Wikimedia Space to appear as a hyperlink, but it said that it wasn't valid either.

Ideally, we'd want both the topic title and the site name in these emails to be hyperlinks.

Looks the same for me. So, it doesn't seem to be a bug in Meta Discourse.

So, I think the %{invite_link} in the admin settings is the link to the topic.
user_notifications.invited_to_topic_body doesn't contain %{invite_link}
whereas invite_mailer.text_body_template and custom_invite_mailer.text_body_template does contain it.

So, this means user_notifications.invited_to_topic_body was used to send the email to Elena, which I think is odd, since I would have assumed the two other texts would be used for that because of the word mailer.

Now I have tried adding

If you're interested, click the link below:


but that also is invalid.

I am clueless! Can you invite me to a topic on our Discourse?

(Side note: I suggest also to remove -- %{site_description} in all three, if we don't intend to have one. The hyphen with nothing following looks a bit weird.)

Email appears to be working fine after the recent Discourse upgrade. I have removed -- %{site_description} from all three texts.

Can someone send me an invite to verify this, please?

Just invited you to a topic to verify.