Creating pre-filled personal message links

:bookmark: This guide describes how to create a link to start a new personal message with pre-filled information, including best practices.

:person_raising_hand: Required user level: All users

Discourse allows you to compose a new personal message with pre-filled information via URL parameters. This can save time and ensure consistency for common messages.

Structure of the URL

To create a new pre-filled message, format your URL like this:

https://discourse.example.com/new-message?username=techapj&title=message%20title&body=message%20body

When broken down, the URL parameters include:

  • Base URL: https://discourse.example.com/new-message
  • Username: username=techapj
  • Title: title=message%20title
  • Body: body=message%20body
  • The ? URL operator to add the different options

You can try this on try.discourse.org:

https://try.discourse.org/new-message?username=rudy&title=message%20title&body=message%20body

You can also compose a pre-filled message for a group via URL:

https://meta.discourse.org/new-message?groupname=team&title=topic%20title&body=topic%20body

Notice the groupname param in above URL, this means that you want to create a new pre-filled message for a group (as opposed to username for composing a message for user). You can also use group_name as an alternative to groupname.

Tags

You can pre-fill tags on a personal message by adding the tags parameter:

https://discourse.example.com/new-message?username=techapj&title=Bug%20Report&body=Details&tags=tag1,tag2

:exclamation: This requires the pm_tags_allowed_for_groups site setting to include the groups that the user belongs to. If PM tagging is not enabled for the user, the tags parameter will be silently ignored.

Best practices

  • You can send message to multiple users by comma separating the usernames. For example

    https://meta.discourse.org/new-message?username=foo,bar
    
  • You don’t need to fill in all of the params. For example any of these would work:

    https://meta.discourse.org/new-message
    https://meta.discourse.org/new-message?username=
    https://meta.discourse.org/new-message?title=foo&body=bar
    https://meta.discourse.org/new-message?groupname=
    
  • You can add line spaces using the %0A and %0A%0D codes to give some structure to the body of the message:

    https://yoursite.discourse.org/new-message?username=test_user&title=Bug%20Report&body=Please%20include%20all%20relevant%20details.%0A%0DCPU:%0AMemory:%0A%0DDescribe%20Issue:
    
  • If you have DiscourseConnect (SSO), you can link to example.com/session/sso and then set the return path to create the personal message. If the user is already logged in they will be redirected automatically to the url supplied by the return path. If they aren’t logged in they will be taken to the DiscourseConnect login page and then redirected to the return path url. The return path will need to be url encoded.

    href="http://localhost:3000/session/sso?return_path=http%3A%2F%2Flocalhost%3A3000%2Fnew-message%3Fusername%3Dscossar%26title%3DInformation+requested+about+gentle+yoga+classes">
    

Currently not supported

  • Use the pre-filled URL to compose a message to multiple groups.
  • Use the pre-filled URL to open the composer in a user’s summary page.
  • Using email instead of the username to pre-fill a personal message.

Additional resources

Last edited by @hugh 2025-07-23T20:13:10Z

Check documentPerform check on document:
56개의 좋아요
Starting creating a new private message via link?
(Mailing List) Link to private message
Link to private message a user from outside via URL
Private message composition URLs don't work with SSO
Move '+ New' Button to Top of Custom Group Page
Feedback form / reporting bugs
How can I compose a link that sends me a PM?
Allow sending Private Messages to Staff
Is there a way to create a link to create a new private message to a specific user with preformed subject and body?
Possible to compose pre-filled MULTI user private message via URL?
Onboarding: Discobot, automated messages, other options?
Possible to compose pre-filled MULTI user private message via URL?
Always allow PM to admin/moderators?
Form template for Personal messages
Create a link that will open the editor with a specific category and a specific tag
Running a photo competition
Help With a Private Topics/Replies Alternative?
Link for new DM / personal chat message with pre-filled information
Sidebar link / top button to PM admin
Prefilled composer link generator
Wizards that send upon submitting a PM to a group or a person
Create a link to start a new personal message without redirect
Could Persona Editor for Discourse become an analogue of GPT Builder based on Discourse in the future?
Quick link to go to personal chat
Placeholder Forms
Discourse Private Replies
Discourse Private Replies
Dark/Light Mode Toggle
Link to start a chat with someone
Is it possible to @mention a user in the banner as a quick access to provide mod/admin support?
Allow multiple ‘new topic’ drafts
Allow multiple ‘new topic’ drafts
Is there a way to have a link that will PM all staff?
Add support for 'personal notes' on posts
Creating personal message to self for taking notes, without filling own username by hand
Creating personal message to self for taking notes, without filling own username by hand
Spoiler but only admins can see it
Creating a link to start a new topic with pre-filled information
Private Message Button in Posts or "Post Menu" area
Open composer for existing topic/personal message via URL
Allow TL0 to write messages to staff group, not to other members or non staff?
How to go about hosting a design contest?
Rename @discobot's start new user command
Fire SSO Login to discourse onLogIn on external site
Weekly exercise topics with hidden replies
Req: new message icon from avatar menu
Directing users to send a PM
Staff Application
Discourse API Get Current Topic

이 방법으로 태그도 할당할 수 있을까요? 여기의 태그 구현 방식을 그대로 따라 해 봤지만, 성공하지 못했습니다.

확실히 같은 코드인 것 같습니다. 어떤 URL을 시도해 보셨나요? 필요하시다면 호스트명을 meta.discourse.org로 대체하실 수 있습니다(다만 실제로 주제를 생성하지는 마세요!).

tags=email,planned과 같은 형식을 사용하셨는지, 해당 태그가 존재하며 링크를 사용하려던 사용자가 해당 태그를 적용할 수 있는지 확인해 보셨나요?

1개의 좋아요

제가 사용했던 URL은 다음과 같습니다:

https://developer.sailpoint.com/discuss/new-message?groupname=community_managers&title=Livestream%20Presentation%20Submission&tags=livestream&body=I%20would%20like%20to%20present%20a%20livestream%21%20Here%20is%20an%20overview%20of%20my%20presentation%3A%0A%0ATopic%3A%20%5B%5Binsert%20topic%20here%5D%5D%0ADescription%3A%20%5B%5Binsert%20description%20here%5D%5D

다만, 태그에 대한 권한 문제에 대해서는 타당한 지적을 하셨습니다. 태그를 숨긴 상태로 PM을 생성할 수 있나요?

사용자가 UX(사용자 경험)를 통해 원하는 태그를 정상적으로 지정하여 PM을 생성할 수 있나요? (힌트: 현재 설정하신 방식이 아닙니다.) URL은 사용자가 UX에서 수행할 수 있는 동작의 시드(seed)를 제공하는 수단일 뿐이며, 마법 같은 힘은 없습니다.

PM에 태그를 활성화하는 사이트 설정이 있습니다. 아니요, 사용자는 자신이 볼 권한이 없는 태그를 생성할 수 없습니다.

1개의 좋아요

확인 결과:

:frowning:

사용자가 현재 보고 있는 URL을 개인 메시지 본문에 포함할 수 있는 방법이 있을까요? 특정 폐쇄 그룹의 사용자들이 특정 토픽을 참조하여 직원에게 메시지를 보낼 수 있도록, 해당 토픽 내에 몇 가지 개인 메시지 링크를 추가하고 싶습니다.

1개의 좋아요