I am using jade template to generate a html email, so I need to retrieve the html content by compiling the jade template. However I would need to pass in variable into the email content, so I have the following codes:
users.js:
var fn = jade.compileFile(__dirname + '/../templates/welcomeEmailTemplate.jade');
var html = fn({base_link:'http://something/'});
and then the welcomEmailTemplate.jade looks like:
img(src= !{base_link} + "image.jpg")
but this gives the error of:
Unexpected token }
on the above line in jade template file.
What should be the correct way to pass in variable in jade.compileFile?
Thanks!