How to get the Template variables to populate?

I’m having some difficulty seeing the pre-filled variables the plugin supports. Every other aspect of this plugin is working as expected, and it’s awesome! :+1: :+1:

I have the Discourse Templates plugin installed, and everything looks up to date. However, all I get when I type:

Hey there, %{reply_to_username}.
Message.
Best regards,
%{my_username}

…is:

Hey there, %{reply_to_username}.
Message.
Best regards,
%{my_username}

:thinking: I was expecting:

Hey there, so_and_so.
Message.
Best regards,
officially_me

Am I missing something?

Try putting

Hey there, %{reply_to_username}.
Message.
Best regards,
%{my_username}

in the first post of a topic in your templates category/tag, then inserting that template from the editor. :slight_smile:

1 Like

I think it depends on the context in which you’re using the template. I’ve just had a run-through to check them out and the %{reply_to_username} won’t populate when replying to the OP, for instance. Though your username should fill out all the time, so not sure what’s going on with that one. :slight_smile:

Could you give a little detail about when you’re using them?

From a little experiment, I think you can nestle the variables as fallbacks of each other too. So I think, Hi %{reply_to_username,fallback:%{original_poster_username,fallback:there}}, would work for both a reply to the OP of a PM as well as a reply to any subsequent messages too (worth testing for yourself though, just to make sure :slight_smile:)

2 Likes

Thank you for clarifying. I was definitely using the plugin not as intended. However, my attempt is being explored further here, in case anyone is interested in using templates for sending PMs.
#wishlist :pray:t4:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.