Send Email When Match in Firebase Database

旧巷老猫 提交于 2019-11-28 06:01:13

问题


I'm trying to build a web app using AngularJS and Firebase that sends an email to two users that match on certain parameters. The users submit their information first and if there is a match with another person in the database, I want to send an email to both those people. For example, if two people, A and B both have the age of 25, I would like to send A and B an email with certain information. Is this possible using Firebase?


回答1:


If you are NOT running a server

Yes

You could achieve it by using a service like Zapier.

You could create a zap linking FireBase and an e-mail service like Mandrill.

A Zap combines triggers and actions — whenever the trigger event occurs, Zapier automatically completes the action for you!

When there is a match, update a special key in your FireBase database.

As Zapier is listening to updates of that particular key, it will react by sending your e-mails via Mandrill.

March 2017 UPDATE

New tools have now been added to Firebase to trigger database event handlers:

  • database events triggers: https://firebase.google.com/docs/functions/database-events
  • cloud functions for FireBase: https://firebase.google.com/docs/functions/functions-and-firebase
  • using cloud functions to send e-mails through sendGrid: https://cloud.google.com/functions/docs/tutorials/sendgrid

If you are running a server

Your server can easily check the values in FireBase and send e-mails accordingly. That would then be a

Yes, of course :)



来源:https://stackoverflow.com/questions/28656191/send-email-when-match-in-firebase-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!