I installed the extension to trigger emails on databse writes. My website has a simple 'Contact me' form, where i'm not expecting a lot of traffic, so I wanted to set-up a simple notification e-mail system.
However, i'm having a hard time getting the confgiuration right.
I configured a firebase trigger e-mail extension:
smtp connection URI: smtp://email:password@smtp.gmail.net:465
email documents collection: messages
default FROM address: Some Name <email>
On every contact form submit, I store the data to firestore in a following format:
let db = firebase.firestore();
db.collection("messages").add({
from: "First Last <email>",
to: "email",
replyTo: "First Last <email>",
message: {
subject: "New message from website!",
text: "some text"
}
})
.then((docRef) => {
console.log("Document written with ID: ", docRef.id);
})
.catch((error) => {
console.error("Error adding document: ", error);
});
Document gets written to Firestore.
The error I see in functions log:
ext-firestore-send-email-processQueue Error when delivering message=messages/vG9gviTCyh1Glxl1vBu1: Error: queryA EREFUSED smtp.gmail.net
Furthermore I see that Firestore collection has gotten a delivery
object added to it with the same error.
Given the above, I think the code part is working - I successfully store the field in the Firestore and it triggers a cloud function. I think the issue is with configuration on either trigger email extension or in gmail settings.
Now, I didn't find much useful about this when googling (using GMAIL with Trigger email extension in firebase) and that's a hint that I may be off to a wrong start and perhaps should look into other options? If that's not the case, then what other settings may I check? I did create myself an app password in gmail, but I don't know where should I submit it in the trigger email extension. Would I also need to configure the gmail as a SMTP server in the Authentication templates configuration?