Erstellen von vorgefüllten persönlichen Nachrichten-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).

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 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 sso 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

56 „Gefällt mir“
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?
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
Spoiler but only admins can see it
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
Private Message Button in Posts or "Post Menu" area
Creating a link to start a new topic with pre-filled information
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
Is there a way to have a link that will PM all staff?
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 Canned Replies
Discourse API Get Current Topic

Können Tags auch damit zugewiesen werden? Ich habe versucht, die Tag-Implementierung von hier nachzuahmen, hatte aber keinen Erfolg.

Ich bin ziemlich sicher, dass es derselbe Code ist. Welche URL hast du versucht? Du kannst den Hostnamen durch meta.discourse.org ersetzen, wenn du musst (erstelle nur nicht tatsächlich das Thema!).

Bist du sicher, dass du etwas wie tags=email,planned verwendet hast und dass die Tags existieren und vom Benutzer, der versucht hat, den Link zu verwenden, angewendet werden können?

1 „Gefällt mir“

Hier ist die URL, die ich verwendet habe:

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
Sie haben einen berechtigten Punkt bezüglich Berechtigungen mit Tags angesprochen. Kann die PM mit ausgeblendeten Tags erstellt werden?

Kann der Benutzer die PM mit den gewünschten Tags normal über die Benutzeroberfläche erstellen? (Hinweis: Nicht so, wie Sie es konfiguriert haben.) Die URL ist nur eine Möglichkeit, das zu säen, was der Benutzer in der Benutzeroberfläche tun könnte. Sie hat keine magischen Kräfte.

Es gibt eine Website-Einstellung, die Tags für PMs aktiviert. Nein, ein Benutzer kann keinen Tag erstellen, den er nicht sehen darf.

1 „Gefällt mir“

Ich habe bestätigt, dass:

:frowning:

Ist es irgendwie möglich, die aktuelle URL, auf der sich der Benutzer befindet, (im PM-Text) einzufügen? Wir möchten einige PM-Links in unseren Themen für eine geschlossene Benutzergruppe einfügen, damit diese unseren Mitarbeitern mit Bezug auf ein bestimmtes Thema eine Nachricht senden können.

1 „Gefällt mir“