# Adding a link in the message invitations

**URL:** https://meta.discourse.org/t/adding-a-link-in-the-message-invitations/130369
**Category:** Support
**Created:** [October 7, 2019, 1:06am UTC](https://meta.discourse.org/t/adding-a-link-in-the-message-invitations/130369 "2019-10-07T01:06:18Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [October 7, 2019, 1:06am UTC](https://meta.discourse.org/t/adding-a-link-in-the-message-invitations/130369/1 "2019-10-07T01:06:18Z")

</div>

When users are invited to a message, it sends them an email with the `user_notifications.invited_to_private_message_body` template:

```plaintext
%{username} invited you to a message

> **%{topic_title}**
>
> %{topic_excerpt}

at

> %{site_title} -- %{site_description}

```

Is there a way to add a link to the message in the template? I tried `%{base_url}%{url}`, but it seems to be invalid for that template.

Users are getting confused, since there is nothing to click. If it isn’t possible to link to the message, I can just send them to the `/my/messages` path, which seems to redirect them to their messages list.

---

<div class="post-metadata">

### Author: ![tohaitrieu](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tohaitrieu/32/151338_2.png) [@tohaitrieu](https://meta.discourse.org/u/tohaitrieu)
#### Post date: [October 7, 2019, 1:51am UTC](https://meta.discourse.org/t/adding-a-link-in-the-message-invitations/130369/2 "2019-10-07T01:51:58Z")

</div>

Do you try to insert the direct link as [https://meta.discourse.org](https://meta.discourse.org) or user html

```
<a href="https://meta.discourse.org">https://meta.discourse.org</a>

```

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [October 7, 2019, 7:30pm UTC](https://meta.discourse.org/t/adding-a-link-in-the-message-invitations/130369/3 "2019-10-07T19:30:49Z")

</div>

Currently, I’ve overridden the template to send users to `forum.example.com/my/messages`, but that’s just the list of all messages. I’m hoping to send them directly to the specific message that they have been invited to.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [October 12, 2019, 10:19pm UTC](https://meta.discourse.org/t/adding-a-link-in-the-message-invitations/130369/4 "2019-10-12T22:19:59Z")

</div>

It seems odd that we don’t include a link in this email @techAPJ? Can you repro?

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [October 14, 2019, 6:57am UTC](https://meta.discourse.org/t/adding-a-link-in-the-message-invitations/130369/5 "2019-10-14T06:57:48Z")

</div>

Yes, this seems like a recent regression from email HTML customization feature. We used to include “Visit Message” link in email footer, not anymore. Will fix on priority.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [October 15, 2019, 6:28am UTC](https://meta.discourse.org/t/adding-a-link-in-the-message-invitations/130369/6 "2019-10-15T06:28:09Z")

</div>

PR here:

[https://github.com/discourse/discourse/pull/8194](https://github.com/discourse/discourse/pull/8194)

Will merge once the PR is reviewed by @neil.

Note that this change is specific to inviting _existing_ users. Inviting new user via email already includes topic/message link per [template](https://github.com/discourse/discourse/blob/16d8e3f872528839b8c765fefa7b57c393b2683e/config/locales/server.en.yml#L2376).

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [October 16, 2019, 9:52am UTC](https://meta.discourse.org/t/adding-a-link-in-the-message-invitations/130369/7 "2019-10-16T09:52:53Z")

</div>

Instead of adding a new `.html.erb` template file I updated the existing user’s invite template to include topic/PM link (similar to what we do for new user invite link) in topic title and at the bottom of email. This also allows staff to use and repurpose `topic_link` as they see fit while customizing invite email template.

> <https://github.com/discourse/discourse/commit/600233482f3bf499e7655a1596908eee32f8cbbb>
>
> FEATURE: allow staff to use topic\_url for customizing email template

Topic:

 ![10](https://global.discourse-cdn.com/meta/original/3X/c/a/ca91d0bbadc5d00104f6dc4744aa56109b202f0f.png)

PM:

 ![46](https://global.discourse-cdn.com/meta/original/3X/2/9/296c95326b16272a0debef4f41cf5e629d360ed6.png)

---

<div class="post-metadata">

### Author: ![j127](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j127/32/79093_2.png) [@j127](https://meta.discourse.org/u/j127)
#### Post date: [October 16, 2019, 11:36pm UTC](https://meta.discourse.org/t/adding-a-link-in-the-message-invitations/130369/8 "2019-10-16T23:36:12Z")

</div>

Thanks, that looks great.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [November 15, 2019, 11:48pm UTC](https://meta.discourse.org/t/adding-a-link-in-the-message-invitations/130369/9 "2019-11-15T23:48:11Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
