Run code for incoming emails with Cloudflare Email Workers
Cloudflare has a feature called Email Workers, that lets you execute a worker as part of an email workflow. This is pretty niche, but I recently used it to create a waitlist and I think it is both very niche and pretty awesome.
Here’s the gist:
- User sends an email to a specific email adress, like waitlist@mycoolthing.io
- The Cloudflare Email Worker which is attached to the email adress gets called
- The worker sends a PUT request to my own service to store the email adress in a waitlist DB table (or, use one of Cloudflares own data storage options directly)
- the email gets delivered as expected to waitlist@mycoolthing.io
In my view, sending the email can be considered an active act (and Cloudflare implements checks regarding email sender adress as far as I can tell), this is a simple way to skip the “confirm your email” workflow for something like a waiting list.