关联的所有信息的电子邮件

关联的所有信息的电子邮件

本文介绍了如何在 Firebase 中发送包含与用户 ID 关联的所有信息的电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

当新用户添加到 Firebase 时,我想向自己发送一封电子邮件,其中包含与该用户关联的所有数据.因此,如果我有一个/contacts 路径和一个/projects 路径,我想在将孩子添加到/contacts 路径时包含来自这两个路径的数据.

When a new user is added to Firebase, I would like to send myself an email with all of the data associated with that user. So if I have a /contacts path and a /projects path, I'd like to include the data from both paths when a child is added to the /contacts path.

我已经使用 Mailgun 查看了 Zapier,但不知道如何完成此操作.

I've looked at Zapier using Mailgun, but can't figure out how to accomplish this.

如果 Zapier 不起作用,是否可以使用 firebase-util 完成此操作?

If Zapier won't work, is this something can be accomplished with the firebase-util?

my-firebase-app.firebaseio.com/contacts 的树

Tree for my-firebase-app.firebaseio.com/contacts

-contacts
--anonymous:-JttGEelQDsVtZ55n3d2
---name: john doe
---address: 100 Main St.
// . . .

my-firebase-app.firebaseio.com/projects 的树:

Tree for my-firebase-app.firebaseio.com/projects:

-projects
--anonymous:-JttGEelQDsVtZ55n3d2
---projectName: "My first project"
---projectDate: July 27, 2015
// . . .

更新:

为了回应下面的评论,这里有一些额外的信息:

In response to the comment below, here is some additional info:

我在 Zapier 中尝试了以下步骤:

I have tried the following steps in Zapier:

  1. 在 Firebase 下选择添加子记录
  2. 在Mailgun下选择Send email
  3. 设置数据路径:/contacts
  4. 在电子邮件正文部分,我插入了Raw Json Data

电子邮件仅包含位于 /contacts 中的 Json 数据.它不包含位于 /projects 中的任何数据.

The email only contains the Json data located in /contacts. It does not contain any of the data located in /projects.

推荐答案

这可以通过 Zapier 轻松完成.

This can pretty easily be accomplished with Zapier.

您已经定义了一个节点,它将触发 Zapier 读取您的数据.然后将 Zapier 设置为观察"该触发节点.您在节点中定义字段,然后在 Zapier 中将它们映射到用于填写电子邮件的变量.

You have define a node that will trigger Zapier to read your data. Then set Zapier to 'observe' that trigger node. You define the fields in the node and then in Zapier, map them to variables that are used to fill in the email.

通常使用这样的东西(ObjC)

In general use something like this (ObjC)

Firebase *zapierRef = [myRootRef childByAppendingPath:@"zapier_queue/out"];

然后,编译你想让 Zapier 读取的数据,我在这个例子中使用的是字典

Then, compile the data you want Zapier to read, I am using a dictionary in this example

NSDictionary *dict = @{
                     @"name", @"john doe",
                     @"address", @"100 main street",
                     @"anonymous: @"-JttGEelQDsVtZ55n3d2",
                     @"projectName": @"My first project",
                     @"projectDate": @"July 27, 2015"
                     }

然后将其写为 Zapier 节点中的 节点

then write that out as a child node in the Zapier node

Firebase *zapChildRef = [zapierRef childByAppendingPath@"data"]

[zapChildRef setValue:dict];

Zapier 将被写入此节点触发,读取数据,将其格式化为电子邮件,然后一旦完成自动删除节点并等待下一条数据.

Zapier will be triggered by the write to this node, read the data, format it into the email and then once completed with automatically remove the node and wait for the next piece of data.

这篇关于如何在 Firebase 中发送包含与用户 ID 关联的所有信息的电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 23:17