Reputation: 123
I have an iOS app that I'm using with Cloud Firestore. I've read the documentation provided by firebase but I'm still unsure how this can be used with swift programming. Does anyone know or have experience with this firebase tigger function implementation with a swiftui app? How can I implement this?
Upvotes: 0
Views: 368
Reputation: 7254
You can use the Trigger Email Extension to send an email when you add a new document to a Firestore collection.
To use this, you'll have to:
db.collection("mail").addDocument(data: [
"to": "[email protected]",
"message": [
"subject": "Hello from Firebase",
"html": "This is an <code>HTML</code> email body."
]
]) { err in
if let err = err {
print("Error writing document: \(err)")
} else {
print("Document successfully written!")
}
}
Upvotes: 2