Skip to content

youssefnabil48/email-stringfy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Stringify

email-stringify is a utility function to stringify emails html files to string with named parameters

Installation

npm i email-stringify --save

How to use

  • Create email-files folder in project root directory
  • Create email.config.js in project root directory

Usage

email.config.js

module.exports = {
//Prefix to wrap named variables in html files 
  prefix: "%%",
//Html Files to include with an array of available variables
  files: {
    test: ["Name"],
  },
};

Get Email String

const { stringifyEmail } = require("email-stringify");
//stringifyEmail takes two paramters
// filename : name of html file
//args : Object containing each variable to change with value
const emailString = await stringifyEmail({
    filename: "test",
    args: { Name: "Ismail" },
  });

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published