إنشاء روابط رسائل شخصية مُعبأة مسبقًا

:bookmark: يصف هذا الدليل كيفية إنشاء رابط لبدء رسالة شخصية جديدة بمعلومات مملوءة مسبقًا، بما في ذلك أفضل الممارسات.

:person_raising_hand: مستوى المستخدم المطلوب: جميع المستخدمين

يتيح لك Discourse إنشاء رسالة شخصية جديدة بمعلومات مملوءة مسبقًا عبر معلمات URL. يمكن أن يوفر هذا الوقت ويضمن الاتساق للرسائل الشائعة.

هيكل عنوان URL

لإنشاء رسالة جديدة مملوءة مسبقًا، قم بتهيئة عنوان URL الخاص بك بهذا الشكل:

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

عند تفكيكها، تتضمن معلمات عنوان URL ما يلي:

  • عنوان 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

لاحظ المعلمة groupname في عنوان URL أعلاه، وهذا يعني أنك تريد إنشاء رسالة جديدة مملوءة مسبقًا لمجموعة (على عكس username لإنشاء رسالة لمستخدم). يمكنك أيضًا استخدام group_name كبديل لـ groupname.

العلامات (Tags)

يمكنك ملء العلامات مسبقًا في رسالة شخصية عن طريق إضافة المعلمة tags:

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

:exclamation: يتطلب هذا إعداد الموقع pm_tags_allowed_for_groups ليشمل المجموعات التي ينتمي إليها المستخدم. إذا لم يكن وضع العلامات للرسائل الخاصة ممكنًا للمستخدم، فسيتم تجاهل المعلمة 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 ثم تعيين مسار العودة لإنشاء الرسالة الشخصية. إذا كان المستخدم قد سجل الدخول بالفعل، فسيتم إعادة توجيهه تلقائيًا إلى عنوان URL الذي يوفره مسار العودة. إذا لم يكن قد سجل الدخول، فسيتم نقله إلى صفحة تسجيل الدخول DiscourseConnect ثم إعادة توجيهه إلى عنوان URL لمسار العودة. ستحتاج إلى ترميز مسار العودة لعنوان 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 المملوء مسبقًا لفتح أداة الإنشاء في صفحة ملخص المستخدم.
  • استخدام البريد الإلكتروني بدلاً من اسم المستخدم لملء رسالة شخصية مسبقًا.

موارد إضافية

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?