Take the 2-minute tour ×

I have a page that sends an email everytime someone opens a shift. These emails are then sent out to a lot of people. If someone opens two shift in a time interval of fx five minutes, then two emails are sent. The application is deployed on app engine so i am interrested in keeping sent mails down to a minimum.

What I would like is to set some timer of fx 10 minutes after the user opens the first shift, and then collect any other shifts that the user may open in this timeinterval, before sending out any mails. Then I can combine it all into one email.

Do any of you have an idea on how to do this on app engine?


Is it also better if the users only receive one email with information on all the shifts that are opened instead of one email per shift. I don't want to spam anyone :)

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You could create a taskqueue task with an ETA 10 minutes in the future. You would give this task a name based on the user's id + a batch id. The batch id should be saved with the user so that all changes within a 10 minute window get the same task name (preventing duplicate tasks in the queue).

When the task executes you would find all changes with the specified batch id, remove the batch id from the user's model so they can start a new batch, build your email, and send it.

share|improve this answer
add comment

Your Answer


