Page MenuHomePhabricator

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

Description

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.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 16 2019, 4:14 PM
elappen-WMF triaged this task as Medium priority.Oct 16 2019, 4:14 PM
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:
https://discuss-space.wmflabs.org/admin/customize/email_templates/user_notifications.user_invited_to_topic

But more interestingly this is the text that substitutes %{message} in the above template:
https://discuss-space.wmflabs.org/admin/customize/site_texts?q=invited%20you%20to%20a%20discussion
(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?

Qgil added a subscriber: Qgil.Oct 23 2019, 8:24 AM

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

elappen-WMF added a comment.EditedOct 23 2019, 6:29 PM

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

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, https://discuss-space.wmflabs.org/admin/customize/email_templates/user_notifications.admin_login), 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:

%{invite_link}

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.)

Aklapper removed a subscriber: Aklapper.Oct 31 2019, 10:16 AM
elappen-WMF closed this task as Resolved.Nov 22 2019, 12:53 AM

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

Qgil awarded a token.Nov 25 2019, 1:11 PM

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

Just invited you to a topic to verify.

Qgil moved this task from Started to Evaluated on the Space (Oct-Dec-2019) board.Nov 28 2019, 5:08 PM