---
title: "Comment by Diptom Saha on \"Send and Schedule e-mails from a Node.js app\" | Hashnode"
description: "Sir, I am building an REST api in node.js.It store a meeting time and 30 before that time it&#39;s send a notifications for that particular meeting.How can I tr"
url: "https://hashnode.com/posts/send-and-schedule-e-mails-from-a-nodejs-app/5d7e656abaf4f00770487f47/comment/5f9d047bb309125fbb619eea"
---

[Discussion](https://hashnode.com/posts/send-and-schedule-e-mails-from-a-nodejs-app/5d7e656abaf4f00770487f47)

Comment [Send and Schedule e-mails from a Node.js app](https://hashnode.com/posts/send-and-schedule-e-mails-from-a-nodejs-app/5d7e656abaf4f00770487f47)

[Diptom Saha](https://hashnode.com/@dip128)

[Oct 31, 2020](https://hashnode.com/posts/send-and-schedule-e-mails-from-a-nodejs-app/5d7e656abaf4f00770487f47/comment/5f9d047bb309125fbb619eea)

Sir, I am building an REST api in node.js.It store a meeting time and 30 before that time it's send a notifications for that particular meeting.How can I trigger this function for a particular time of every meeting.

[Tapas Adhikary](https://hashnode.com/@atapas)

[Nov 1, 2020](https://hashnode.com/posts/send-and-schedule-e-mails-from-a-nodejs-app/5d7e656abaf4f00770487f47/comment/5f9d047bb309125fbb619eea#reply-5f9e79a8701b426a980956bb)

Hello [Diptom Saha](https://hashnode.com/@dip128),

You can use `node-cron` for creating a cron job if it has to be happening at a particular time of the day, day of the week, and so on.

```
  let cron = require('node-cron');
```

In your case, as the meeting time is known, the cron job can be created with the time that is `meeting_time - time_offset(30 mins for example)`.

The cron.schedule method is capable of taking the customizable pattern too.

```
cron.schedule('* * * * *', () => {
   console.log('running a task every minute');
});
```

Cron allowed fields are,

# ┌────────────── second (optional)

# │ ┌──────────── minute

# │ │ ┌────────── hour

# │ │ │ ┌──────── day of month

# │ │ │ │ ┌────── month

# │ │ │ │ │ ┌──── day of week

# │ │ │ │ │ │

# │ │ │ │ │ │

So when you schedule the meeting, schedule a cron also accordingly.

Hope it helps.
