Simple Rust app that will send POST requests to an IFTTT webhook.
This will then can create other events/notifications on a smart phone.
Notifications can be configured/scheduled from a JSON or can be manually triggered via an API request.
To use, open notify.toml
and update the webhook key (See IFTTT config below).
Then just run/build the project using cargo cargo run --release
(Or use docker/docker-compose).
Note: I will be uploading binaries soon™ to GitHub.
To create repeating scheduled notifications, update the JSON file data/notifications.json
(See below for an example). Scheduled notifications can be disabled via the config in notify.toml
.
[
{
"title": "Sample Notification 1",
"content": "Some message",
"cron": "*/1 * * * *",
"enabled": false
},
{
"title": "Sample Notification 2",
"content": "Some message 2 with an image!",
"image": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/Google_2015_logo.svg/368px-Google_2015_logo.svg.png",
"cron": "*/7 10 * * *",
"enabled": false
}
]
- title = The title of the notification received on the IFTTT mobile app
- content = The content of the notification received on the IFTTT mobile app
- image = The url of an image to include in the notification received. This is optional
- cron = The cron expression for when the notification will run (must be 5 fields long, starting at minutes)
- enabled = Disable/enable a notification from being sent. requires restart if changed
Notify will host a web server that can receive http requests. Web server can be configured (including disabled) within the config notify.toml
.
Endpoint | Method | Description | Response |
---|---|---|---|
/notification |
POST | Accepts incoming notification JSON and sends API request to IFTTT. | 204: No Content (Success) 400: JSON object containing error and timestamp |
/health |
GET | Returns health and uptime of the service. | 200: JSON object containing uptime |
Body of POST request should be like this:
{
"title":"Title of notification",
"content":"Content of notification"
}
- title = The title of the notification received on the IFTTT mobile app
- content = The content of the notification received on the IFTTT mobile app
- image = The url of an image to include in the notification received. This is optional
The service is best ran using a docker-compose file. Use the sample provided:
version: '3.3'
services:
notify:
container_name: notify
image: coombszy/notify:latest
volumes:
- ./config:/app/config
- ./data:/app/data
- /app/config = Folder to store the
notify.toml
for the service - /app/data = Folder to store notifications JSON
Currently, you cannot publish an IFTTT applet if it uses the webhook functionality. So i've included instructions on how to make the services yourself:
- Create a new applet with the following 'If This' and 'Then That'
- The 'If This' should be configured as so
- And the 'Then That' should be configured like this
-
Finally you will need to get your Webhooks key from the Webhooks Service FAQ. Insert this API key into the
notify.toml
config file for theifttt_key
. -
If you chose a different event name in step 2, change
notify.toml
variableifttt_event
to the value you set.
If you are looking for the legacy version, it can been found here. And the update notes can be found here.
Some useful links