How to send email with all information associated with user id in Firebase

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.

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

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

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

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

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

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

UPDATED:

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

I have tried the following steps in Zapier:

  1. Selected Add child record under Firebase
  2. Selected Send email under Mailgun
  3. Set path to data: /contacts
  4. In the email body section, I inserted Raw Json Data

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

Answers


This can pretty easily be accomplished with 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.

In general use something like this (ObjC)

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

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"
                     }

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

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

[zapChildRef setValue:dict];

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.


Need Your Help

Jersey - cookie set on a client does not arrive to the server

java cookies jersey

I am writing a client application with jersey java libraries, I am not succesfull in sending cookies to the server. Where is my mistake? Here is my code:

Why is removeEventListener not working?

actionscript-3 flash

Can anybody please tell me why the removeEventListener call is not working?