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

[backend] Create a lambda cron function to send push notifications #133

Open
pfortuna opened this issue Mar 28, 2020 · 6 comments
Open

[backend] Create a lambda cron function to send push notifications #133

pfortuna opened this issue Mar 28, 2020 · 6 comments
Assignees
Labels
release issues that will be released next

Comments

@pfortuna
Copy link
Contributor

We first need to investigate how we can implement this.

We want to send a message to all the users if they haven't submitted a "actualização de estado" for more than 24h.

This message is triggered by a recurring lambda function that runs everyday, starting at H and is sent in batches every N configurable minutes.
Example configuration:
H = 8pm
N = 10min
These parameters must be stored in .env

The endpoint must only be exposed to the mechanism that calls the endpoint. Regular users must not be able to call this. Perhaps we need to implement Roles+JWT.

@pfortuna
Copy link
Contributor Author

We also need design and copy for the push notification.

The message can perhaps be a parameter sent to the endpoint.

@pfortuna pfortuna added Copy This issue is waiting for Copy work enhancement New feature or request UIUX This issue is waiting for UIUX work labels Mar 28, 2020
@pfortuna
Copy link
Contributor Author

Another idea for a push notification is:

  • Once a day (must not coincide with the other push notification above), send a push notification to users whose postal code had more than X status updates from other users since he last visited (column last_login). X is a var defined in env.
  • The time for this push notification must not coincide with the time for sending the first push notification described in the first post of this thread.

We will need copy for this push.

@pfortuna
Copy link
Contributor Author

pfortuna commented Apr 1, 2020

@geiras the design above are not push notifications. I believe push notifications all have the same design, a rectangle. That means that we only need the copy to move forward.

@pfortuna
Copy link
Contributor Author

pfortuna commented Apr 2, 2020

No design is needed here. My mistake.

Push notifications we want:

  • We want to send a message to all the users if they haven't submitted a "actualização de estado" for more than 24h. Sent at 8pm, with 10min intervals every batch.
  • A push notification to users whose postal code had more than X status updates from other users since he last visited (column last_login). X is a var defined in env.

Example parameters:
[
{
"title": "push title 1",
"message": "message body 1"
"scheduled": "8pm",
"batchInterval": "10min",
"batchSize": 5000
},
{
"title": "push title 2",
"message": "message body 2"
"scheduled": "12pm",
"batchInterval": "10min",
"batchSize": 10000
},
...
]

I'll attach copy later.

@pfortuna pfortuna added release issues that will be released next and removed Copy This issue is waiting for Copy work UIUX This issue is waiting for UIUX work enhancement New feature or request labels Apr 3, 2020
@pfortuna pfortuna changed the title [spike] Create a lambda cron function to send push notifications [backend] Create a lambda cron function to send push notifications Apr 5, 2020
@carlospombeiro carlospombeiro self-assigned this Apr 5, 2020
@carlospombeiro
Copy link
Contributor

carlospombeiro commented Apr 5, 2020

This requires a new lambda.

Execute script should be something like
npm run notify-users-no-update-24h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release issues that will be released next
Projects
None yet
Development

No branches or pull requests

4 participants