In this post, I would like to explain how to send emails using a Firebase extention, called Trigger Email. With that extention, it is possible to send emails by simple creating documents on Cloud Firestore.
Setting up Gmail account
Trigger Email extention uses SMTP to send emails, but SMTP is disabled by default for Gmail accounts. So we need to enable SMTP for Gmail here.
Setting up Trigger Email
Visit this link and choose a Google Cloud project to enable this extention.
Click Next for step 1, 2 and 3.
At Step 4, we need to fill in two fields: SMTP connection URI and Default FROM address. SMTP URI for gmail is in the form of:
<password>with the Gmail account you want to use.
Next field is Default FROM address, which will be the same as the
<email>at step 3. So if you have a Gmail account
email@example.com its password 123456, the filled in fields would look like in the image below:
You can click on Install Extention button at the end of the page. This will bring you to Installed Extentions page.
After the installation done, we need to create a collection called
Next, we will add a document in
tofield with the receiver email.
Here is how it looks like on Firestore dashboard:
After you hit Save the extention will process the document and you will receive an email in about 30 seconds.