Pass variable to html template in nodemailer

前端 未结 8 2195
礼貌的吻别
礼貌的吻别 2021-01-30 16:45

I want to send email with nodemailer using html template. In that template I need to inject some dynamically some variables and I really can\'t do that. My code:



        
8条回答
  •  遇见更好的自我
    2021-01-30 17:25

    This can be done without templates.

    Try changing it to this:

    `Hello ${username}!`
    

    Make sure that these are not inverted commas but back ticks.

提交回复
热议问题