One of the things I'm using Firebase for in my app is to store user-submitted feedback - using push()
to add children to a location. Ideally I could receive an email whenever a new child was added to that location, but this could only be done directly by some Firebase service, or perhaps somewhat indirectly by some Firebase service that could hit a URL (containing a tiny script that emails me), but I can't find any mention of either ability.
One thing I can think of is something like a little Node.js server constantly running and listening to that reference with on('child_added', cb)
, emailing me when something changes. I'm using Firebase to try to build this app without having a server, so I'd rather not have to do that. I'm thinking of just having a cron job on my personal computer that periodically checks the location over the REST API. Any better ideas?
The easy solution is to use a third-party service. Firebase has really great integration with Zapier. This service allows you to easily integrate Firebase with tons of different services and technologies without writing any code. One of these technologies is email. You can create a "zap", for free, which will run on their servers and automatically watch for new children of a Firebase path then send that child's information to you as an email. It's only takes seconds to set up and you don't have to write a line of code.
Unfortunately Zapier can no longer use firebase as a trigger. That said you could setup a Firebase cloud function using Node.JS. There is a pretty good list of sample functions here: https://github.com/firebase/functions-samples
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With