Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add admin api to send targeted push notifications #2135

Merged

Conversation

holzeis
Copy link
Contributor

@holzeis holzeis commented Mar 1, 2024

Adds an admin api allowing to send targeted push notifications to a list of users using their node ids. Note, if the user opted to not receive notifications, he will not get that campaign message.

With the dry_run flag you can test to how many users the message will be sent to and validate if the message is as expected before actually sending it.

$ curl localhost:8000/api/admin/campaign/push -d '{"node_ids":["027775c06af68dd0fbd1591a3da81afd13f7680c015ec48a76ae290bf48225a486"], "title": "test", "message": "this is a test", "dry_run": false }' -H "Content-Type: application/json"
Sending push notification campaign (title: test, message: this is a test to 1 users%

fixes https://github.com/get10101/meta/issues/364

@holzeis holzeis self-assigned this Mar 1, 2024
@holzeis holzeis force-pushed the feat/add-admin-api-to-send-targeted-push-notifications branch 2 times, most recently from 0b87420 to 1c59581 Compare March 1, 2024 14:36
coordinator/src/campaign.rs Outdated Show resolved Hide resolved
coordinator/src/campaign.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@bonomat bonomat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some nits.

@holzeis holzeis force-pushed the feat/add-admin-api-to-send-targeted-push-notifications branch from 1c59581 to 39dc8e6 Compare March 4, 2024 08:17
@holzeis holzeis force-pushed the feat/add-admin-api-to-send-targeted-push-notifications branch from 39dc8e6 to d98e85e Compare March 4, 2024 08:35
@holzeis holzeis enabled auto-merge March 4, 2024 08:35
@holzeis holzeis added this pull request to the merge queue Mar 4, 2024
Merged via the queue into main with commit 3786bb4 Mar 4, 2024
20 checks passed
@holzeis holzeis deleted the feat/add-admin-api-to-send-targeted-push-notifications branch March 4, 2024 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants