Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

replace string template

/* Simple Hello World in Node.js */
let a = {link:'www.subdomain.com', requestId:'12345', userNameFormat:'US-ENGLISH'};

let mailBody = 'This is an automatic notification to let you know that the records  on #requestId# you had requested are now available for you to view #userNameFormat#. Please log in to the application by clicking the following link: #link#';

Object.keys(a).forEach(key => {
   mailBody = mailBody.replace(`#${key}#`,a[key]);
});
console.log(mailBody);

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.