事前入力された個人メッセージリンクの作成

:bookmark: このガイドでは、事前入力された情報を含む新しいプライベートメッセージを開始するためのリンクの作成方法とベストプラクティスについて説明します。

:person_raising_hand: 必要なユーザーレベル: すべてのユーザー

Discourseでは、URLパラメーターを介して事前入力された情報を持つ新しいプライベートメッセージを作成できます。これにより、時間を節約し、一般的なメッセージの一貫性を確保できます。

URLの構造

事前入力されたメッセージを作成するには、URLを次のようにフォーマットします。

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

内訳は次のとおりです。

  • ベースURL: https://discourse.example.com/new-message
  • ユーザー名: username=techapj
  • 件名: title=message%20title
  • 本文: body=message%20body
  • 異なるオプションを追加するための ? URL演算子

try.discourse.orgで試すことができます。

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

また、URLを介してグループの事前入力されたメッセージを作成することもできます。

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

上記のURLのgroupnameパラメーターに注意してください。これは、ユーザー宛てのメッセージを作成するのではなく(ユーザーの場合はusername)、グループの新しい事前入力されたメッセージを作成したいことを意味します。 groupnameの代替としてgroup_nameを使用することもできます。

タグ

tagsパラメーターを追加することで、プライベートメッセージのタグを事前入力できます。

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

:exclamation: これには、サイト設定のpm_tags_allowed_for_groupsにユーザーが属するグループが含まれている必要があります。PMタグ付けがユーザーに対して有効になっていない場合、tagsパラメーターはサイレントに無視されます。

ベストプラクティス

  • ユーザー名をコンマ区切りにすることで、複数のユーザーにメッセージを送信できます。例:

    https://meta.discourse.org/new-message?username=foo,bar
    
  • すべてのパラメーターを入力する必要はありません。たとえば、これらはすべて機能します。

    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=
    
  • メッセージ本文に構造を与えるために、%0A%0A%0Dコードを使用して改行を追加できます。

    https://yoursite.discourse.org/new-message?username=test_user&title=Bug%20Report&body=Please%20include%20all%20relevant%20details.%0A%0DCPU:%0AMemory:%0A%0DDescribe%20Issue:
    
  • DiscourseConnect(SSO)を使用している場合、example.com/session/ssoにリンクし、次にreturn_pathを設定してプライベートメッセージを作成できます。ユーザーがすでにログインしている場合、指定されたreturn_pathのURLに自動的にリダイレクトされます。ログインしていない場合は、DiscourseConnectログインページに移動し、その後return_pathのURLにリダイレクトされます。return_pathはURLエンコードする必要があります。

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

現在サポートされていない機能

  • 複数のグループにメッセージを作成するために、事前入力されたURLを使用すること。
  • ユーザーの概要ページでコンポーザーを開くために、事前入力されたURLを使用すること。
  • プライベートメッセージを事前入力するために、ユーザー名の代わりにEメールを使用すること。

追加リソース

「いいね!」 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?
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 API Get Current Topic
Onboarding: Discobot, automated messages, other options?