It would be helpful to be able to use the To: username (in PMs) for Templates

Continuing the discussion from Discourse Templates:

Unfortunately this doesn’t work for my main use-case for actually using Templates!

I want to be able to address the user I’m targeting in a new personal message, usually in relation to a post that they have made. This is in order to educate them or nudge them to better behaviour.

However, none of those variables work for this.

  • my_username
    • gives me
  • original_poster_username
    • gives me
  • reply_to_username
    • returns nothing
  • last_poster_username
    • also nothing
  • reply_to_or_last_poster_username
    • nothing

Could we please have one for a PM addressee somehow? I’ve got no idea how to do that. It would be fine if it only worked for a PM with a single participant (apart from yours truly).


Would it be possible to have use a variable that inserts the name of a PM recipient?


Would %{target_username} be the appropriate variable?

I’d also love it if this were a possibility :raised_hands:t4: as we’re most likely to use templates to start a PM thread than as a public reply. For example, when we award custom badges.


Is that a variable that exists in the plug-in or were you making a suggestion as to how it could look like?

No, that one doesn’t have a variable at the moment, though it would be very useful.

I’ve split this into a feature topic for consideration. I actually spotted that there was an existing topic, so have moved it over here to group the requests together. :+1: :slight_smile: