Mattermost-server: Channel links should show as links in notification emails

Created on 11 Sep 2018  Â·  17Comments  Â·  Source: mattermost/mattermost-server

If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.


Notes: Jira ticket

Original report: https://github.com/mattermost/mattermost-server/issues/9024

Steps to repro:

  1. Turn on email notifications
  2. Write a message to the account containing channel links (e.g. "~channel1")

Expected behavior
In the HTML-Email, channel should be linked to the channel URL, same as how they appear in Mattermost

Observed:
Channels in emails are not links, they appear as raw text in the form ~channel_name

AreEnd User Feature Medium Help Wanted PR Exists TecGo

Most helpful comment

I'd be happy to take a stab at this!

All 17 comments

I'd be happy to take a stab at this!

Thank you @claytonlemons 🎉

Hey @claytonlemons , let us know if you have any questions, happy to help!

@claytonlemons Are you still working on this? If not I would like to take this up.

@waseem18 As there hasn't been any update on this one from @claytonlemons: Go ahead and work on this, please :+1:

@waseem18 Did you already start an this issue? Do you have any questions?

Not yet @hanzei

Thanks for the reply. Looking forward to your PR!

@waseem18 If in case you are not working on this, can I pick this up?

@sandlis Now that work on the Calendar plugin came to an end, I was planning to work on this starting today.

In case I'm unable to, I'll let you know.

Okay, no problem.
Thanks for the response!

Regards,
Sandeep Sukhani

On Thu 24 Jan, 2019, 4:04 PM Wasim Thabraze <[email protected] wrote:

@sandlis https://github.com/sandlis Now that work on the Calendar
plugin came to an end, I was planning to work on this starting today.

In case I'm unable to, I'll let you know.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/mattermost/mattermost-server/issues/9399#issuecomment-457148957,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABQgedAN1GJQPsO8Mo3UAc-Q6vMoyInPks5vGYwlgaJpZM4WjqnB
.

Update : Started working on this.

I plan to do this in this way :

  1. Use regex to find channel mentions in the message and check if the channel exists using GetChannelByNameForTeamName.
  2. If the channel exists, wrap the channel mention in an anchor tag so that the HTML code can render this valid channel mention as a hyper link.

@hanzei Let me know if there's a better way to solve this.

PR on the way.

This is a fine approach. Looking forward to your PR :tada:

I see waseem18 finished most of this. I can finish it up with the suggestion from esethna to only link Public Channels.

Great, thanks @mjthomp95!

PR recently merged. Thanks @mjthomp95 for your contribution!

Was this page helpful?
0 / 5 - 0 ratings