how to send bulk emails from firebase console? - firebase

I am trying to find the feature in firebase console to send bulk emails to the registered users in the firebase. But not able to find one.
Please suggest me how can I send the bulk emails through the firebase console to the registered users with the email ids in the Firebase Authentication

There is no built-in feature to send bulk emails from Firebase. The only built-in email sending capacity is around signing in with Firebase Authentication, and the contents of those emails is tightly controlled by Firebase to prevent it being used for sending spam.
If you want to send your own emails from Firebase you'll have to build it on top of Firebase, typically using Cloud Functions as sending email reliably is best done from a trusted environment.
Two examples of sending emails from Firebase:
Using the trigger email extension, which sends an email when data is written to the Firestore database.
Using the email confirmation sample for Cloud Functions, which works similarly as the extension.
Both of these require you to provide your own SMTP server details, which means you are in control of abuse prevention.

Related

I want connect my firebase information with my mail

I just created a contact form and I use firebase realtime database to get the information of the website visitor who want to contact me.
and now I want receive an email with the information form firebase each time a visitor send a contact submission from the web site.
how can I connect firebase realtime database with my email?
thank you
I hope this will help you achieve your desired functionality.
One way of doing is by using Firebase Cloud Functions. You state that you want to receive an email after a user persists information to firebase Realtime database. I suggest have a thorough look at Firebase Cloud Functions and look under firebase real-time database triggers. These functions get executed or are triggered after an operation(delete, update, write) occurs within the database. Also have a look at Firebase Functions Send Email for how to implement the email sending part.

Email verification without having a FirebaseUser

I'm trying to send a verification email without having a firebaseUser, is it possible ?
I know i can do it with user.sendEmailVerification() method but can i do it just by giving an email from a textfield ?
Based on what I knew and what I've read from the documentation, it looks like it's not possible to do this. A Firebase user, a.k.a an user authenticated within Firebase platform is required if you want to send email verification that uses Firebase Email Vetification service.
Well, do not lose hope since there are plenty workarounds to do this. What I would do to achieve this is to use Firebase Cloud Functions to create serverless API platform. I connect Firebase Cloud Functions with Firebase Admin SDK (which also has access to other Firebase services if I am not mistaken).
I send an email using some kind of email service providers such as SendGrid to designated email address (which the app got from user's inputted email) and provide a link to verify there (in the e-mail that sent to designated email address). Then, in the cloud functions, you leverage Firebase Admin SDK to change verification status.
This approach is flexible though, as it can be used to verify a user not only with Firebase Authentication.
Hope it helps. If it's not clear for you, just comment.
Happy coding.
EDIT: After thoroughly read your question again, I realized that my answer is not fully correct. Somehow you still need a specific user to be added within Firebase Authentication database, which you would not want to do manually and let your app do so instead. Perhaps you can use Firebase Admin SDK in this matter. You can read official Firebase documentation for more information regarding Admin SDK.

Get messaging tokens from Go admin backend when adding users to Firebase, over upon registration in Javascript

I haven't seen any examples of this, but I want to purely interact with Firebase through the backend, and not the frontend with Javascript.
I have auth tokens being minted on my Go backend when a new user is added and then these users are written into a mongo database.
What I want is to be able to get a messaging token for my users, and then add it to their user document in mongo, that'll be used to send messages through the backend.
The reasoning is that we don't want to have to communicate with Firebase on our frontend.
Is this even possible?
If you want to send a message directly to a device with Firebase Cloud Messaging, you will definitely need some information from the client. There is no avoiding following the setup instructions on the client. In particular, you will have to handle the registration token on the client and send it to your backend so it can send the messages.
The Firebase Authentication token will not be useful to you at all for sending messages. FCM doesn't send messages to users - it sends messages to devices (or topics). You will have to figure out for yourself which devices belong to which users.

Can a user's Firebase device ID key be used by multiple Firebase service providers?

If I share a user's Firebase device ID key (for a user who has my app installed) with other Firebase service providers, can they send messages from their account (using their authentication key) to a user who has my app installed?
Yes I do realize the process of sharing a user's Firebase device ID key could be problematic. The problem I am trying to solve is that I want multiple providers to be able to send messages to a user who has my app installed.
The Firebase Instance ID (also known as a registration token, or FCM token) identifies an installation of your app on a specific device.
Sending messages to such tokens in a project always requires an additional form "authentication.
The Firebase Cloud Messaging versioned REST API requires that the user has a service account. If you create a service account for each of your service providers, you grant them complete access to your Firebase project. So they can't only send FCM messages, they can also access every other Firebase product: e.g. delete your database, read all your users, etc.
The legacy REST API for Firebase Cloud Messaging instead uses a Server Key to authorize its callers. If you share your FCM server key with other service providers, they can only send FCM messages with that key. But they can send whatever messages they want to whatever user.
You might want to consider setting up your own API endpoint on Cloud Functions for Firebase. That way you can determine yourself how to secure that API, and what you allow your service providers to send to what users of your app.
Assuming that the Firebase Device ID Key you're referring to is the FCM Registration token, then having the value alone won't enable others to send a message to it without the corresponding Server Key it is associated with.
For your use-case of allowing multiple senders to a single app, you could refer to the official documentation on Receiving messages from multiple senders. I believe my answer here could also be helpful.

Receiving Emails with Google Cloud Functions in Firebase

I'd like to build an email drop service. Is it anyhow possible to receive incoming emails with Google cloud functions, process them and store them in firebase db?
I'm thinking of something similar to Amazon simple email service SES in combination with lambda functions. Does any of the available email services like sendgrid, mailgun, postmark or any other has api's to trigger Google Cloud Functions on incoming emails?
Yes, services like Sendgrid and Mailgun allow you to set up webhooks for incoming mail. You can configure these webhooks to point to an HTTPS Cloud Function, at which point it will be invoked each time you get a new incoming email.

Resources