notifme / notifme-sdk

A Node.js library to send all kinds of transactional notifications.
https://notifme.github.io/www/
MIT License
1.94k stars 149 forks source link

Custom Notification Catcher connection #55

Closed mjlescano closed 6 years ago

mjlescano commented 6 years ago

Hi @BDav24! First of all, thanks for this lib, is awesome 😊

About this PR

It adds the possibility to configure the connection options to the Notification Catcher using the env var NOTIFME_CATCHER_OPTIONS. It was straightforward implemented thanks to the option of using an string url on Nodemailer's SMTP transoport: https://nodemailer.com/smtp/.

Use case

This allowed me to use the Notification Catcher with docker-compose, without the need to install-as-dev and run the Catcher on my node app:

version: '3'

services:
  myNodeApi:
    build:
      context: .
    environment:
      - NOTIFME_CATCHER_OPTIONS=smtp://notifier:1025?ignoreTLS=true
    command: ["npm", "run", "dev"]
    ports:
      - 3000:3000
    volumes:
      - ./api:/usr/src/api
      - /usr/src/node_modules
    depends_on:
      - notifier

  notifier:
    image: node:8.11.2-alpine
    command: ["npx", "notification-catcher"]
    ports:
      - 1080:1080
BDav24 commented 6 years ago

@mjlescano Thanks for the PR!