# כיצד למלא את משתני התבנית?

**URL:** https://meta.discourse.org/t/how-to-get-the-template-variables-to-populate/271526
**Category:** Support
**Tags:** templates
**Created:** [12 ביולי,‏ 2023,‏ 4:27pm UTC](https://meta.discourse.org/t/how-to-get-the-template-variables-to-populate/271526 "2023-07-12T16:27:28Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![michellefs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michellefs/32/234543_2.png) [@michellefs](https://meta.discourse.org/u/michellefs)
#### Post date: [12 ביולי,‏ 2023,‏ 4:27pm UTC](https://meta.discourse.org/t/how-to-get-the-template-variables-to-populate/271526/1 "2023-07-12T16:27:28Z")

</div>

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! 👍 👍

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}

🤔 I was expecting:

> Hey there, so\_and\_so.  
> Message.  
> Best regards,  
> officially\_me

Am I missing something?

---

<div class="post-metadata">

### Author: ![hello-smile6](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hello-smile6/32/304628_2.png) [@hello-smile6](https://meta.discourse.org/u/hello-smile6)
#### Post date: [12 ביולי,‏ 2023,‏ 5:41pm UTC](https://meta.discourse.org/t/how-to-get-the-template-variables-to-populate/271526/2 "2023-07-12T17:41:38Z")

</div>

Try putting

```plaintext
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. 🙂

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [13 ביולי,‏ 2023,‏ 11:18am UTC](https://meta.discourse.org/t/how-to-get-the-template-variables-to-populate/271526/3 "2023-07-13T11:18:16Z")

</div>

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. 🙂

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 🙂)

---

<div class="post-metadata">

### Author: ![michellefs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michellefs/32/234543_2.png) [@michellefs](https://meta.discourse.org/u/michellefs)
#### Post date: [20 ביולי,‏ 2023,‏ 7:40pm UTC](https://meta.discourse.org/t/how-to-get-the-template-variables-to-populate/271526/4 "2023-07-20T19:40:18Z")

</div>

Thank you for clarifying. I was definitely using the plugin not as intended. However, my attempt is being explored further [here](https://meta.discourse.org/t/it-would-be-helpful-to-be-able-to-use-the-to-username-in-pms-for-templates/263469), in case anyone is interested in using templates for sending PMs.  
_#wishlist_ 🙏🏽

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [11 בספטמבר,‏ 2023,‏ 9:03pm UTC](https://meta.discourse.org/t/how-to-get-the-template-variables-to-populate/271526/5 "2023-09-11T21:03:43Z")

</div>

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