Creación de enlaces de mensajes personales pre-rellenados

:bookmark: Esta guía describe cómo crear un enlace para iniciar un nuevo mensaje personal con información prellenada, incluyendo las mejores prácticas.

:person_raising_hand: Nivel de usuario requerido: Todos los usuarios

Discourse te permite redactar un nuevo mensaje personal con información prellenada a través de parámetros de URL. Esto puede ahorrar tiempo y asegurar la consistencia para mensajes comunes.

Estructura de la URL

Para crear un nuevo mensaje prellenado, formatea tu URL de esta manera:

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

Desglosado, los parámetros de la URL incluyen:

  • URL base: https://discourse.example.com/new-message
  • Nombre de usuario: username=techapj
  • Título: title=message%20title
  • Cuerpo: body=message%20body
  • El operador de URL ? para añadir las diferentes opciones

Puedes probar esto en try.discourse.org:

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

También puedes redactar un mensaje prellenado para un grupo mediante la URL:

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

Nota el parámetro groupname en la URL anterior; esto indica que deseas crear un nuevo mensaje prellenado para un grupo (a diferencia de username para redactar un mensaje para un usuario). También puedes usar group_name como alternativa a groupname.

Etiquetas

Puedes prellenar etiquetas en un mensaje personal añadiendo el parámetro tags:

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

:exclamation: Esto requiere que el ajuste del sitio pm_tags_allowed_for_groups incluya los grupos a los que pertenece el usuario. Si la asignación de etiquetas en mensajes personales no está habilitada para el usuario, el parámetro tags se ignorará silenciosamente.

Mejores prácticas

  • Puedes enviar un mensaje a varios usuarios separando los nombres de usuario con comas. Por ejemplo:

    https://meta.discourse.org/new-message?username=foo,bar
    
  • No necesitas rellenar todos los parámetros. Por ejemplo, cualquiera de estos funcionaría:

    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=
    
  • Puedes añadir saltos de línea usando los códigos %0A y %0A%0D para dar algo de estructura al cuerpo del mensaje:

    https://yoursite.discourse.org/new-message?username=test_user&title=Bug%20Report&body=Please%20include%20all%20relevant%20details.%0A%0DCPU:%0AMemory:%0A%0DDescribe%20Issue:
    
  • Si tienes DiscourseConnect (SSO), puedes enlazar a example.com/session/sso y luego establecer la ruta de retorno para crear el mensaje personal. Si el usuario ya ha iniciado sesión, será redirigido automáticamente a la URL proporcionada por la ruta de retorno. Si no ha iniciado sesión, será llevado a la página de inicio de sesión de DiscourseConnect y luego redirigido a la URL de la ruta de retorno. La ruta de retorno deberá estar codificada en la 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">
    

Actualmente no compatible

  • Usar la URL prellenada para redactar un mensaje a varios grupos.
  • Usar la URL prellenada para abrir el compositor en la página de resumen de un usuario.
  • Usar el correo electrónico en lugar del nombre de usuario para prellenar un mensaje personal.

Recursos adicionales

56 Me gusta
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?