Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rosekamallove/newsletter-api
This is a API allowing the user to send emails to the subscribed users in the database, the subscribers can be subscribed to a various topics or all the topics. The user of the API can schedule the sending of the email to the priciseness of a second.
https://github.com/rosekamallove/newsletter-api
Last synced: 12 days ago
JSON representation
This is a API allowing the user to send emails to the subscribed users in the database, the subscribers can be subscribed to a various topics or all the topics. The user of the API can schedule the sending of the email to the priciseness of a second.
- Host: GitHub
- URL: https://github.com/rosekamallove/newsletter-api
- Owner: rosekamallove
- License: mit
- Created: 2022-05-05T14:29:07.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-05-06T15:40:37.000Z (over 2 years ago)
- Last Synced: 2024-12-07T15:43:20.878Z (15 days ago)
- Language: JavaScript
- Size: 45.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## Tech Used:
`express`, `nodemailer`, `node-schedule`, `mongodb`
## Steps to Configure:
### Step 1:
**Configure the `.env` file**
```
$: cat .env.examplemongooseUri=
contactEmail=
contactPassword=
contactHost=
```- Create a `.env` files and add the above variables to it with their corresponding values.
- To get the mongoose uri you can follow [this](https://mongoosejs.com/docs/connections.html) guide
- Then to get SMTP mail, password and HOST you can follow [this](https://nodemailer.com/usage/why-smtp/) guide### Step 2
- Configure the time at which emails has to be sent
- This can be done by editing the following line, by following [this](https://www.npmjs.com/package/node-schedule) guide
- Line **71** in `/scheduler/mailer.js````js
schedule.scheduleJob("*/10 * * * * *", async function ()
```### Step 3
- Run the application by running these commands:
```
$: nodemon app.js
$: nodemon ./daemons/subscription.daemon.js
```