mtw

module
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2024 License: MIT

README

mtw

mtw is the proxy that converts email notifications into webhooks.

Quick start

With Docker
docker run -e "SECRET=mysecret" -e "DOMAIN=localhost.lan" -v ./data:/db -p "8080:8080" -p "25:25" -d zenentonal/mtw:v0.0.5

Tutorial

Step 1. Make an address
curl -XPOST localhost:8080/address/user/alice \
     -H 'Authorization: Bearer mysecret'

{"address":"alice@localhost.lan"}
Step 2. Make a webhook
curl -XPOST localhost:8080/webhook \
     -H 'Authorization: Bearer mysecret' \
     -H 'Content-Type: application/json' \
     --data-raw '
{
    "endpoint": "https://hooks.slack.com/services/xxxx",
    "method": "POST",
    "schema": "{\"text\": \"{{Escape .Text | Limit 3000}}\"}",
    "content_type": "application/json"
}'

{"id":"19116242-dfdc-4b94-bce6-0b4cc90ec372"}
curl -XPOST localhost:8080/address/alice@localhost.lan/webhook/19116242-dfdc-4b94-bce6-0b4cc90ec372 \
     -H 'Authorization: Bearer mysecret'

Licence

MIT

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL