how to send notification email from composer using sendgrid - airflow

I'm trying to send notification email from cloud composer, thus, I followed the officiel documentation, here is what I done until now :
I created sendgrid account
I defined a sender (a gmail account), that I verified
however, I run the test nothing happened.
Is there something that I'm missing ?

Related

Can I use firebase trigger mail without admin sdk

I tried to use trigger mail, I set up the extension and made a write to the database but the trigger mail operation was rejected this was the error: "Error: Missing credentials for "PLAIN"". The docs show examples of using the admin sdk to write the data for trigger mail. My question is do I absolutely need to use the admin sdk for this, and if so where do I store the adminkey.json that firebase generates for me, for security purposes?

How to send topic messages through firebase console?

I am trying to send news messages to all app users. I thought about using Firebase Cloud Messaging. It is implemented on the client (Android app) and registered for a topic. Now I would like to send a message through the Firebase Console to this topic.
Is this possible? And how can I send a firebase message to a specific topic using the firebase console? I searched on the website, but did not find the option. Or is this only possible using a script (e.g. PHP) to send a message to a specific topic.
In the Notification composer of the Firebase console, enter a title and text for your message.
Then click Next.
In the next page, click the Topic button to send the message to a topic:

firebase function triggered on email received

Is there a way to trigger a firebase function or create an item in Firestore when an email is received on Gmail or Outlook.
I'm trying to recreate on of ServiceNow's features where in if the helpdesk email address has received an email, it will automatically create a ticket (to firestore) out of it.
Thank you!
Here is one possible solution for Gmail (untested):
According to the Gmail API documentation:
The Gmail API provides server push notifications that let you watch
for changes to Gmail mailboxes... Whenever a mailbox changes, the Gmail
API notifies your backend server application.
...
The Gmail API uses the Cloud Pub/Sub API to deliver push notifications.
Since you can trigger a Cloud Function whenever a new Pub/Sub message is sent to a specific topic you can do as follows:
Set up a Cloud Pub/Sub client.
Using your Cloud Pub/Sub client, create the topic that the Gmail API should send notifications to.
Configure the Gmail account(s) to send notifications for mailbox updates
Write a Cloud Function that is triggered whenever a new Pub/Sub message is sent to this topic and execute the desired Business Logic (e.g. write to Firestore)
For Outlook, this SO answer indicates that it should be possible to call an API when a new mail is received. You could either call an HTTPS Cloud Function or directly the Firestore REST API.

allAuthenticatedUsers for a cloudFunction to send a push notification: perl client side code

I have written a HTTP cloud function called send_push. It basically receives payload from a perl script and sends out push notifications via FCM to the tokens provided. Tested it in unauthenticated mode and everything works well. This "perl script" is open source. People download that perl script and use it to send notifications to my mobile app (which they buy from the app/play store). So obviously, the perl script cannot come with any of my secrets or service accounts.
I now want to add authentication to that cloud function. My goal is to allow my function to be called by any user who is signed into google using their own credentials. To enable this, I've gone to https://console.firebase.google.com/u/0/project/<myproject>/authentication/providers and enabled "Email/password" and "google" in the hopes that anyone who signs up using an email/password or directly via google login can then invoke my function. I've also enabled allAuthenticatedUsers for my send_push function and removed allUsers
Have I made the right assumptions? I've been going around in loops trying to parse the cloud functions authentication documentation.
If I have made the right assumptions, what libraries can I use on the perl script side that can prompt the user to enter their login credentials (via google or email sign up) and then use that data to generate and refresh tokens? They won't have gcloud installed, so I can't do things like $(gcloud auth print-identity-token) for authentication, which I think anyway is for developers.
Note that the sample cloud authentication code shows how my endpoint can authenticate against firebase users that have registered with _my_app. This is not what I want.

Enabling the notification feature for my firebase app

I have made an app with the use of firebase. It is basically a chat application in which you van send and receive the text and images. I want to add a functionality in it that whenever a user sends a msg, then another user should get a notification . When I try to send a notification through the firebase console, then it is working, but when a user messages through the app, then it is not showing any notification to another user. So, can anyone tell me that how can this functionality be achieved ?Also, provide some sample code to see how things are working
You need to use cloud functions for that:
https://firebase.google.com/docs/functions
Cloud Functions for Firebase lets you automatically run backend code in response to events triggered by Firebase features and HTTPS requests
First, you can register the user to a topic:
FirebaseMessaging.getInstance().subscribeToTopic("news");
https://firebase.google.com/docs/cloud-messaging/android/topic-messaging
Then when the message is sent to the database, you can use onWrite() in cloud functions which is a database trigger to be able to send the notification.
https://firebase.google.com/docs/functions/database-events

Resources