Using Variables in Templates
Configuring Variables for Message Templates
Select Edit ▸ Plugins.
-
Click Templates.
If a plugin is not available under Edit ▸ Plugins, then please ask in a support forum of your distribution. Your distribution might have decided to disable some plugins or to ship plugins in a separate package.
Click the Configuration tab.
You can add, edit or remove the key-value pairs. You can specify any number of key-value pairs.
在任何模板中,所有出现关键字的地方会被它所对应的值代替。例如,如果您在设置了关键字为“经理”,值为“哈里”,那么邮件中所有出现“经理”的地方都会被“哈里”代替。
Assume that you have 1000 message templates with your current manager's name in them. When the current manager is replaced by a new one, it is not easy for you to manually replace the manager's name in all the 1000 messages. If the messages have a $Manager key value, you can reset the value in the Configuration tab of this plugin.
默认情况下,整个环境变量会被作为一个关键字-值对来对待。每出现一个环境变量就会被它所对应的值所代替。例如,模板中有$PATH时,当使用模板时就会被它的值代替。
关键字-值的替换过程根据下列优先级进行:
关键字会被它在模板插件中配置的值所替换。
如果该关键字在配置中找不到,则会被环境变量所对应的值替换。
如果该关键字既不是环境变量,也没有进行配置,则不会发生任何替换。