问题
i need to schedule email send, i'm using node-cron. i want to know how to use "req.body" for date and time to schedule.

i need help to resolve how insert in this part of code the req.body
cron.schedule('* * * * *')
and if useful to use
<input type="time">
<input type="date">
Thanks for all
回答1:
Since the node cron expression is string you can pass the variables in form of string something like
let c="0";
cron.schedule(`${c} * * * * *`, ()=>{ // you can use template literals to pass variable args
// your job runs every minute
})
Like wise you can pass different arguments according to your requirements. You can refer official documentation of node cron here-https://www.npmjs.com/package/node-cron
来源:https://stackoverflow.com/questions/55555493/how-to-schedule-email-whit-req-body-and-node-cron