模板插值键用法

与本帖相关,我们之前曾自定义模板,例如 user_notifications.reply_by_email,内容如下:

  • 访问主题 或回复此邮件以进行回应。
  • [通过私信回复](%{base_url}/new-message?username=%{username}&title=您的帖子 %{topic_title_url_encoded}&body=关于您在 %{base_url}%{url} 中的帖子)

第二项包含的链接为:

%{base_url}/new-message?username=%{username}&title=您的帖子 %{topic_title_url_encoded}&body=关于您在 %{base_url}%{url} 中的帖子

该链接已使用一段时间且运行正常。今天我们需要修改 user_notifications.reply_by_email 中的文本,但在保存时收到以下错误:

以下插值键无效:"username, topic_title_url_encoded"

为何现在会出现此限制?我们该如何解决?

值得庆幸的是,现在这里有相关文档:https://meta.discourse.org/t/interpolation-keys-for-customizing-text-and-email-templates/264604。