Menu icon Foundation
Automate emails from a template

I've got a number of emails that I want to put different data into.

At the moment, I'm generating the email with placeholder text and then replacing them with my node app before I send them.

I was wondering if anyone had any ideas for how I should go about creating a template in Inky, replacing the values and then generating the email.

I can do the first bit easy enough using handlebars to generate the input, but whats the best way of automating the conversion in javascript from the inky input to the html email?

automate

I've got a number of emails that I want to put different data into.

At the moment, I'm generating the email with placeholder text and then replacing them with my node app before I send them.

I was wondering if anyone had any ideas for how I should go about creating a template in Inky, replacing the values and then generating the email.

I can do the first bit easy enough using handlebars to generate the input, but whats the best way of automating the conversion in javascript from the inky input to the html email?

Corey Schaaf over 2 years ago

Are you trying to use a json or yml file for data? Just trying to understand the extent of variable data from email to email. 

Niall over 2 years ago

Hi Corey,

I'm using a json file.

I managed to get where I want by followings the build process in the gulpfile.babel.js.

Then I worked out there was an easier way by prefixing my handlebars stuff with \ before I did the build. So now I can just use the normal method for creating the email, then run the output through handlebars with my data.

Thanks for the reply though,

niall