Add different buttons in the same reply template

AI-generated summary

The discussion revolves around enhancing reply templates in Discourse to include multiple buttons for different actions, such as public replies or private messages (PMs) to the post author. jimkleiber suggests a feature allowing users to send PMs directly to the author without manually entering the recipient’s name, proposing a create_pm_reply option. Aizada_M asks if it’s possible to add a second button using the same template, aiming to reduce clutter from multiple templates. simon clarifies that the Reply Template component doesn’t support multiple buttons in one template, so two templates are needed. However, simon also notes that PMs can now be sent to specific users using the usernames parameter, with usernames separated by commas (e.g., `usernames=

I love this and I think it may help a lot with running classes where I have people answer reflection questions or even as a pseudo form.

One thing I want to explore is if people can reply directly to the post’s author with a PM without having to type the recipient’s name. In this way, I could post an exercise or drill and then people could reflect privately to me using the template, which in some scenarios I may love. I could also provide the same template but with two different buttons, where they can reply publicly in the topic or privately in a PM to me (or the author).

I know it’s not that hard for people to add a recipient in the PM composer, I just wonder, would it be easy to add an option for something like create_pm_reply or something that will go directly to the author of the post to which one is replying?

2 Likes

Greetings, dear forum participants and Discourse administration!
I wanted to ask. Is there any command to create a second button using the same template. For example, a user could use one template at his own discretion - for a private message or to create a public response.
Here’s an example:

2 Likes

I like the idea, but I don’t think this can be done with the Reply Template theme component. The theme component creates the button automatically for you and doesn’t supply any place that a second button could be added. You will need to add two reply templates to the topic in order to get close to what you are looking for.

I realize this is an old question, but the topic was bumped a few days ago. I’m not sure where things were at in May 22, but you can now add either a list of one or more users to send the PM to by using either the recipients or usernames parameters: Reply Template.

2 Likes

Yes, that’s what I’m doing for today. But when there are many templates, informational noise is created. I wanted to solve this in a more delicate way(

I realize this is an old question, but the topic was bumped a few days ago. I’m not sure where things were at in May 22, but you can now add either a list of one or more users to send the PM to by using either the recipients or usernames parameters: Reply Template .

Yeah, I understand, it turns out that usernames should be written separated by commas or is it sufficiently separated by spaces?

Usernames need to be separated by a comma, with no space after the comma. For example:

usernames="sally,Ben"
3 Likes