Adding a link in the message invitations

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

%{username} invited you to a message

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


> %{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.


Do you try to insert the direct link as or user html

<a href=""></a>
1 Like

Currently, I’ve overridden the template to send users to, 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.

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


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.


PR here:

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.


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.




Thanks, that looks great.

1 Like

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