---
title: "Discussion on \"Send and Schedule e-mails from a Node.js app\" | Hashnode"
description: "Discussion on \"Send and Schedule e-mails from a Node.js app\". As an application developer, how often do we sense the need for a service that would send e-mails to specified or subscribed email ids? Even if there is no real need, we still fantasize about it while developing a side-project or an app for fun, don'..."
url: "https://hashnode.com/posts/send-and-schedule-e-mails-from-a-nodejs-app/5d7e656abaf4f00770487f47"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Send and Schedule e-mails from a Node.js app](https://blog.greenroots.info/send-and-schedule-e-mails-from-a-nodejs-app?utm_source=hashnode&utm_medium=feed)

As an application developer, how often do we sense the need for a service that would send e-mails to specified or subscribed email ids? Even if there is no real need, we still fantasize about it while developing a side-project or an app for fun, don'...

Sep 15, 2019 · 4 min read · blog.greenroots.info  
Updated Jul 19, 2021  
Read the article

-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#sailsjs](https://hashnode.com/tag/sailsjs)
-   [#programming](https://hashnode.com/tag/programming)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

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

@atapas · Bangalore

  
[View profile](https://hashnode.com/@atapas)

Educator @tapaScript | Founder CreoWis & ReactPlay - Writer - YouTuber - Open Source

Co-Founder, @CreoWis | Teacher, @tapaScript | Founder, @ReactPlay | YouTuber | Writer | Human

## Responses 1

Markdown supported · ⌘↵ to post

[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.
