It's a uncomplicated API sends messages by MS Teams and E-mail with settings previously storage.
10K+
It's a uncomplicated API sends messages by Microsoft Teams and E-mail with settings previously storage by itself, to abstract their complexities.
Takes advantage of Apprise API through your network with a user-friendly self-guided API.
For now it's available to send notifications to 2 services (Email and teams).
A production ready micro-service at your disposal.

About docker-compose, see it here.
version: "3.1"
services:
mongo:
image: mongo:4.4.1
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
apprise:
image: caronc/apprise
restart: always
notification-service:
image: woobase/product-base.notification:latest
restart: always
environment:
HttpAppriseBaseUrl: "http://apprise:8000"
MongoConnection__ConnectionString: "mongodb://root:example@mongo:27017"
MongoConnection__Database: "MyDatabase"
ports:
- 8080:80
docker-compose -f docker-compose.yml up -d
You may also want to send your notifications relying message queues security like RabbitMQ.
version: "3.1"
services:
mongo:
image: mongo:4.4.1
container_name: mongo
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
ports:
- 27017:27017
apprise:
image: caronc/apprise:latest
container_name: apprise
restart: always
ports:
- 8000:8000
volumes:
- /var/lib/apprise/config:/config
rabbitmq:
image: masstransit/rabbitmq:latest
container_name: rabbitmq
restart: always
environment:
RABBITMQ_DEFAULT_USER: user
RABBITMQ_DEFAULT_PASS: password
ports:
- 15672:15672
- 5672:5672
notification-consumer:
image: woobase/product-base.notification-consumer:latest
container_name: notification-consumer
restart: always
environment:
HttpAppriseBaseUrl: "http://apprise:8000"
MongoConnection__ConnectionString: "mongodb://root:password@mongo:27017"
MongoConnection__Database: "DataBaseName"
RabbitMqSettings__Host: rabbitmq
RabbitMqSettings__Username: user
RabbitMqSettings__Password: password
notification-service:
image: woobase/product-base.notification:latest
container_name: notification-service
restart: always
environment:
HttpAppriseBaseUrl: "http://apprise:8000"
MongoConnection__ConnectionString: "mongodb://root:password@mongo:27017"
MongoConnection__Database: "DataBaseName"
RabbitMqSettings__Host: rabbitmq
RabbitMqSettings__Username: user
RabbitMqSettings__Password: password
Jwt__Enabled: "false"
ports:
- 8080:80
Here you should store the connectors' settings to use after when you'll send notifications using only the name of configuration key.
If some parameter is wrong, them Notification Service will guide you to fit the requirements.
With Email:
curl --header "Content-Type: application/json" \
--request POST \
--data '{"keyname":"business","providerType":"email", "Parameters":{"userid": "username", "pass": "password", "domain": "gmail.com", "to": "email1,email2"}}' \
http://localhost:8080/api/v1/connector
With Teams you need to generate an incoming webhook:
curl --header "Content-Type: application/json" \
--request POST \
--data '{"keyname":"buildStatuses","providerType":"teams", "Parameters":{"webhookUrl": "your webhook from"}}' \
http://localhost:8080/api/v1/connector
| Name | Required | Description |
|---|---|---|
| keyname | yes | It's name of channel configuration. It'll be using to send notification. |
| providerType | yes | It represents the name of type connector, in this case its value should be "teams". |
| webhookUrl | yes | It's a web hook url belongs a channel group of Microsoft Teams is going to receive the notification. See how to get, here. |
| Name | Required | Description |
|---|---|---|
| keyname | yes | It's name of channel configuration. It'll be using to send notification. |
| providerType | yes | It represents the name of type connector, in this case its value should be "teams". |
| domain | yes | It's a domain name. If your email is [email protected], your domain is example.com. |
| userid | no | It's a name of email user. If your email is [email protected], your userid is username. |
| pass | no | It represents the password of email who sends notifications. |
| smtp | no | It's a SMTP Server address. |
| port | no | It's the SMTP por, by default is 25. |
| mode | no | The Mode allows you to change the connection method. Some sites only support SSL (mode=ssl) while others only support STARTTLS (mode=starttls). The default value is starttls. |
| from | no | If you want the email address ReplyTo address to be something other then your own email address, then you can specify it here. This field can override on sending. |
| name | no | With respect to {from_email}, this allows you to provide a name with your ReplyTo address. |
| to | no | It's represents who receive the notification. This field can override on sending. |
| cc | no | Carbon Copy email address(es). More than one can be separated with a space and/or comma. |
| bcc | no | Blind Carbon Copy email address(es). More than one can be separated with a space and/or comma. |
For more details of email parameters, see it here.
Now to send notification you just need to provide a list of channel (created in before step), title and body!
curl --header "Content-Type: application/json" \
--request POST \
--data '{"channels":["business", "buildStatuses"],"title":"Hello world", "body": "Thank you!"}' \
http://localhost:8080/api/v1/notification
When sending notification to email, you can overwrite the recipient list using "to" parameter.
curl --header "Content-Type: application/json" \
--request POST \
--data '{"channels":["business", "buildStatuses"],"title":"Hello world", "body": "Thank you!", "to": "newEmail1,newEmail2", "from": "myEmail"}' \
http://localhost:8080/api/v1/notification
| Name | Required | Description |
|---|---|---|
| channels | yes | A list of settings key, created on configurations. |
| title | yes | The title of notification, can be a phrase or a name. |
| body | yes | It's the content of notification. |
| to | no | This field override who receives the message. It only works to send e-mail. |
| from | no | This field override the name who sends the message. It only works to send e-mail |
MIT License
Copyright 2021 Woobase
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Content type
Image
Digest
Size
86.7 MB
Last updated
about 5 years ago
docker pull woobase/product-base.notification