我正在使用handlebar模板在发送之前动态准备电子邮件内容。
只传递一个值是很简单的。例如:
使用template.apply(firstName)时,What's up {{this}}模板工作得很好。
已尝试将模板更改为What's up {{this}}, {{this}},并尝试由template.apply(lastName);和template.apply(firstName);填写。
但它不起作用。
在我的Handlebar tmp.hbs模板中,我就是这样使用我的自定义注册a助手的
<p>{{a "this is a message by the author"}}</p>
它会返回
<p>THIS is A message BY the AUTHOR</p>
现在,我需要使消息成为动态消息。基本上,我需要在最后添加{{name}}变量的值,这样输出就是(使用name: 'pippo')
<p>THIS is A message BY pippo</p>
有没有办法将字符串与变量连接