简体   繁体   English

发送 欢迎 Email iOS Firebase 认证

[英]Send Welcome Email iOS Firebase Auth

I currently have an iOS App that uses Firebase with my database.我目前有一个 iOS 应用程序,它使用 Firebase 和我的数据库。

I am trying to get my users a welcome email after a successful sign up.在成功注册后,我试图让我的用户欢迎 email。

Does anyone know how I can make this possible?有谁知道我怎样才能做到这一点?

Thanks!谢谢!

Firebase has no built-in API for you to send email directly from the client, as that would attract way too much spam. Firebase 没有内置 API 供您直接从客户端发送 email,因为那样会吸引太多垃圾邮件。

The most common approach to do this with Firebase is through the use of Cloud Functions, which are (typically small) Node.js functions that run in an environment managed by Google Cloud, and that are triggered by events happening inside your Firebase project.使用 Firebase 执行此操作的最常见方法是使用云函数,这些函数(通常很小)Node.js 函数在由 Google Cloud 管理的环境中运行,并且由 Z035489FF8D3927419943E 项目内发生的事件触发。

Two such triggers that are relevant here:与此处相关的两个此类触发器:

  1. You can run a Cloud Function in response to a user account being created in Firebase Authentication.您可以运行云 Function 以响应在 Firebase 身份验证中创建的用户帐户。 For an example of this, see Send a welcome email when a user completes signup .有关这方面的示例,请参阅当用户完成注册时发送欢迎 email
  2. You can run a Cloud Function in response to a document being written to Cloud Firestore, or a value being written to the Realtime Database.您可以运行 Cloud Function 以响应写入 Cloud Firestore 的文档或写入实时数据库的值。 For one example of this, see Send confirmation emails to users subscribing/unsubscribing to a newsletter .有关这方面的一个示例,请参阅向订阅/取消订阅时事通讯的用户发送确认电子邮件

You could use all of these to then send an email through an SMTP server that you have credentials for.您可以使用所有这些,然后通过您拥有凭据的 SMTP 服务器发送 email。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM