discourse_narrative_bot.new_user_narrative.hello.message
doesn’t accept
%{new_user_tips}
is there a reason for it?
The discussion revolves around the use of interpolation keys in Discourse templates, particularly in the context of discourse_narrative_bot and user_notifications.reply_by_email. BlackKnob questions why %{new_user_tips} is not accepted in discourse_narrative_bot.new_user_narrative.hello.message, to which gerhard responds that only interpolation keys defined in the original English text are allowed, and %{new_user_tips} is not used in that specific template. BlackKnob clarifies that %{new_user_tips} is linked to system_messages.usage_tips.text_body_template and is used in other templates like welcome_user and welcome_invite. kimardenmiller adds confusion about valid interpolation keys, citing a working example in user_notifications.reply_by_email that includes keys like %{username} and %{topic_title_url_encoded}. However, they now encounter an error when trying to save changes to this template, as these keys are flagged as invalid. The core issue is the restriction on using arbitrary interpolation keys in translations and templates, despite prior successful usage.
discourse_narrative_bot.new_user_narrative.hello.message
doesn’t accept
%{new_user_tips}
is there a reason for it?
Why should it? You can’t use arbitrary interpolation keys within translations. Only the ones used in the English text and this particular text doesn’t use any interpolation.
not sure what you mean by “arbitrary”.
%{new_user_tips} links to system_messages.usage_tips.text_body_template and can be used in:
system_messages.welcome_user.text_body_template
system_messages.welcome_invite.text_body_template
I’m also confused on this topic of valid interpolation keys in templates. We previously customized templates such as user_notifications.reply_by_email, e.g. to say …
The second item has the link:
%{base_url}/new-message?username=%{username}&title=Your%20post%20%{topic_title_url_encoded}&body=Regarding%20your%20post%20in%20%{base_url}%{url}
This has been in use for some time and works perfectly. Today we need to change the text in user_notifications.reply_by_email, but on saving get the error:
The following interpolation key(s) are invalid: "username, topic_title_url_encoded"
Why the limitation now, and how can we get around it?