While building Iconduck, I ran into a common situation: I wanted to email users after 24 hours to get feedback on what they thought.
I didn't want to create a cron (I loathe crons). So I
thought a low-tech approach would be to have some 3rd-party
service hit an endpoint of mine after 24 hours. Something
like:
https://website.com/send-user-123-a-welcome-email
.
I assumed there would be some 3rd party service that would facilitate this, but no luck. So, I built my own, low-tech webhook service using AWS API Gateway and AWS Lambda.
Here is a sample endpoint:
wget https://aws-api.416.io/boomerang/v1/track/in-24-hours/https://your-url-here.com/
The above does exactly what you'd expect it to: in 24 hours,
it will make a request to
https://your-url-here.com/
. It's that simple.
I use Sugar, a JavaScript library, for parsing the date and time strings. It's pretty solid. Anything that Sugar can handle (eg. "in 4 hours", "tomorrow at 8am"), Boomerang (my codename for now) can handle.
Here are a bunch of date / time strings that have been tested and work:
- In 10 minutes (
in-10-minutes
) - Sunday at 11:00am (
sunday-at-1100am
) - Tomorrow at 16:00 (
tomorrow-at-1600
) - Next Monday at noon (
next-monday-at-noon
)