Simple Example to Use Cron Job and Sending Email with Typescript and NodeJs with node-cron and nodemailer
In this case, i just want to explain the simple example of how to use node-cron and nodemailer in nodejs with Typescript for sending scheduled email.
- Just clone this repo
https://github.com/ahadsenja/simple-nodecron-nodemailer-typescript.git
- Enter to the project directory.
- Install the dependencies with
npm install
oryarn install
. - Open two terminal in your computer or vscode:
- At the first terminal, run
yarn ts
for compiling .ts into .js file to "build" directory. - At the second terminal, run
yarn dev
for running the application.
- Typescipt ^4.6.3
- node-cron ^3.0.0
- nodemailer ^6.7.3
- nodemon ^2.0.15
I know this prject is not perfect, and i'm sorry for that, but I hope this can be helpful for starting with node-cron and nodemailer as a basic understanding.
I will update this docs file as soon as possible, sorry for the lack.