Discourse Canned Replies

Have a feature request: would it be possible to allow sorting of replies manually? Our most common reply falls to the bottom of the list, and the least used is at the top. I’d like to avoid naming them A_..., AA_..., etc.


Shouldn’t they be automatically ordered by frequency of use anyway?


That would work just as well - at the moment they’re alphabetical, never changing based on use.

That was something that I proposed when developing the plugin, in the end I went with alphabetical order. I’ll implement it soon.

Regarding the automatic replaces, I’ll try to implement the @username variable to see how hard it is to do. If it goes well maybe I can add a few more :wink:


@jomaxro I pushed an update to the plugin that adds two ways of sorting the canned replies list: alphabetically or by frequency of use. The list is originally sorted by frequency of use, but you can toggle between the two modes after.

Let me know if that works for you.


I was just wondering if you had seen my post above about the title being able to be populated on new topics when using the Canned Replies. Also would it be possible to use this via the api? I’m guessing not straight off however.

I did, but that would require a larger redesign of the plugin. I’ll add it to the to-do list and implement when I can.

Regarding the API, it’s better to ask a more experienced Discourse developer since I never had to work with it.

No problem thank you :slight_smile:

Would it possible make this plugin working for groups or trust levels (via site settings) in addition to the staff?

In our specific case (support forum) it would be great if:

  • admins can choose which groups (or TL) can edit or add new canned replies
  • admins can choose which groups (or TL) can add a canned reply in a specific category

Sure, I’ll add it to the to-do list.


Can you make sure the default sort is frequency of use? That’s the only one that makes sense to me.


It is, but it only starts counting the frequency of use after you update the plugin.


Submitted PR for italian translation


I’m not able to create a canned reply (and this was my first tryout), the log error saying:

Uncaught TypeError: Discourse.ajax is not a function
Url: https://community.example.com/assets/application-bf3194c2601b23131a8cf7cf208b144b7a401a11d73f6323409ce2f2558b2046.js
Line: 68
Column: 22832

Whatever the last change happened at Discourse update, most of the plugins are giving the Uncaught TypeError: Discourse.ajax is not a function . If I’m not wrong, this could be the reason and the plugin fix update is required.

I think (if its not already happening), these types of major changes had to be announced with “URGENT WARNING: CALL FOR COMPATIBILITY UPDATE” to all Discourse Plugins coders/producers at the moment of such important change decisions!. Otherwise many of us loosing a lot of valuable time reporting and rebuilding for each plugin. Am I right?

I am pretty sure this (unanticipated) bug has been fixed - I’d suggest you rebuild and try again. If you are worried about compatibility and bugs, in future you may want to wait until you are prompted to upgrade discourse.


I hope its done. But I’m already rebuilding almost everyday these days. The last one was before some hours. I’ll try again.

Thank you for your suggestion but at my Admin page, its showing the sad face asking for upgrade ;). After then, with every rebuild its updating itself automatically. I never expected that I’ll face that much of conflicts. Actually I was hoping that it may be a solution for some already problematic plugins.

Edit: I just did a rebuild and nothing changed.

Edit (2nd Nov.) : It’s working now :slight_smile:

So we’re seeing some strange issues with Canned Replies lately at Stonehearth. When first opening Canned Replies, nothing is in the dropdown (in the past the most used option was selected by default). If you select the first option, it does not show the preview. You have to select a different option to get a preview, then select the first option again to get it to appear.


I think @eviltrout fixed something else with it today.

Certainly possible, but I didn’t see any recent commits…

I did some major refactoring to canned replies today so do upgrade and let me know if you encounter any bugs.

One thing which I’ve removed is the ability to sort alphabetically because that feature is covered by searching in the combobox. I’ve also made some UX changes like disabling the save button when saving, hiding edit button when a canned reply hasn’t been selected and input validation when the input fields are blank.