0

enter code hereI have a created a shoppingCart app and I have to send the order to the client in email using nodemailer I cannot destructure this object

this object can have many similar values like this

{"5e4083f2c3231acf1ded8b1f":
{"item":
{
  "_id":"5e4083f2c3231acf1ded8b1f",
  "imagePath":"https://ahn9mtnal7pbz2v5wyw2gqon.drv.tw/ait.jpeg",
  "title":"My img",
  "description":"lambi cjhori decstkjfnsjknf fhfhf time nhi hai",
  "price":100},
  "qty":1,"price":100,"singlePrice":100}}

I have tried

let iofi = JSON.stringify(cart.items);

console.log("  iofi = stringify cart.items : "+ iofi );

let cartItemsvalues = Object.values(cart.items);

console.log("CV",cartItemsvalues);

and only ${iofi} works in nodemailer Html: output

Penny Liu
  • 15,447
  • 5
  • 79
  • 98
Abdul
  • 11
  • 2

0 Answers0