Reputation: 896
We have a Flutter project with Firebase setup we would like to create a Firebase cloud function with node js that perform the following:
Every 27th of any month check the subscription date from the subscription collection. And create a new document in invoices collection then finally send an email & FCM with a payment URL.
Upvotes: 0
Views: 70
Reputation: 83181
For that you need to use a scheduled Cloud Function.
More precisely, you need to:
0 0 27 * *
, i.e. at 00:00 on day-of-month 27.For the last 3 points, you need to use the Admin SDKs since you are coding in a Cloud Function. (Doc for Firestore and doc for Messaging)
Upvotes: 1