Joe
Joe

Reputation: 343

Flutter firebase trigger email implementation

I've been trying to create a contact form for my flutter project. The contact form is composed of two steps. First, the user provides their email and then describes their issue. Once the user presses submit, I want to receive an email on my end. I've look at several packages like mailer and flutter_email_sender. However, they don't seem to offer good solutions; mailer requires that I provide the password to my email address in my code (opening up the possibility for vulnerabilities). Flutter_email_sender simply opens up an email app on the phone.

Recently I've come across the perfect solution, Firebase's new extension Trigger Email. Although the extension seems promising, I can't find any resources outlining proper implementation of Trigger Email in Flutter.

Can you please provide an example of how Trigger Email can be implemented in Flutter project?

Upvotes: 0

Views: 1665

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599766

From the documentation of the extension:

Use this extension to render and send emails that contain the information from documents added to a specified Cloud Firestore collection.

So to send an email you write a document to Cloud Firestore. For examples of writing to Cloud Firestore from Flutter, see the FlutterFire documentation for examples of this.

Upvotes: 1

Related Questions