This is simpler server that you can subscribe newsletter and get notification by Slack. It can be easily done with paid plan, but we can also do it for free! You can subscribe multiple newsletters divided by your own category. This notification system is using Slack app Incoming Webhooks. Slack provides 10 apps for free plan and one of them is going to be used by this service for error tracking. Thus, you can make 9 categories at maximum.
- Your own domain
- Server connected to your domain
- MX record should be set. You can refer this link if you need.
node
andnpm
should be installed.
- Create Slack workspace where you want to get notification.
- Create channels to get newsletter. Each channel means its category(e.g. Science, Business...).
- Add
Incoming Webhooks
app for each channel (how?) and get webhook URL for each channel.- One of them should be made for error message
- Clone this repository
git clone https://github.com/GrasshopperBears/newsletter-slack
- Create
.env
file at the root of this repository. There should be keys as belowYou should fill in webhook urls atSLACK_WEBHOOK_ERROR= # necessary SLACK_WEBHOOK_TECH= # example SLACK_WEBHOOK_CULTURE= # example ... SERVER_HOST=example.com MAIL_TO=newsletter # example, username for newsletters. SAVE_MAIL_DIR=/home/newsletter/Maildir # example
.env
file. In this example, you will get newsletter bynewsletter@example.com
. - You can change configuration files(
subscription-list.js
,webhook-url.js
) as you want.
npm i
npm i -g pm2
npm start