I'm creating a series of ecommerce emails that uses a huge load of data, as including all this variables on top of files is not an option, I'd like to load this data from a JSON file.
Couldn't find anything on docs of both Maizzle or Front Matter to do that. There's just a few instructions about which expressions is allowed on top of template files.
My workaround is loading JSON files on config.js but whenever I change content from JSON, rendered e-mail does reload but only html content not data from JSON. Forcing me to stop and restart process.
const dataOne = require('./src/path/data-one.json')
const dataTwo = require('./src/path/data-two.json')
const dataThree = require('./src/path/data-three.json')
module.exports = {
build: {
// build config object
},
locals: {
// locals variables
},
data: {
dataOne,
dataTwo,
dataThree,
}
}
<p>{{page.data.dataOne.first_name}}</p>
Is it possible to achieve that using Front Matter syntax?
I'm creating a series of ecommerce emails that uses a huge load of data, as including all this variables on top of files is not an option, I'd like to load this data from a JSON file.
Couldn't find anything on docs of both Maizzle or Front Matter to do that. There's just a few instructions about which expressions is allowed on top of template files.
My workaround is loading JSON files on
config.jsbut whenever I change content from JSON, rendered e-mail does reload but only html content not data from JSON. Forcing me to stop and restart process.Is it possible to achieve that using Front Matter syntax?