The 'child_added'
event probably isn't a good choice for this purpose. That event doesn't mean that a child has just been newly added to some collection in Firebase; it triggers for every child that loads from Firebase when your ref
has child objects, in addition to triggering when a child is newly added. So every time you load that collection (e.g. when you restart your server) your mailer is called for every child that loads (hence the duplication).
You are probably better off sending a traditional http request to trigger the mailer from your angular action when a new submission is added.
I suppose you could add a field indicating whether or not the child has already been mailed, and only mail children that haven't been on a 'child_added'
event. But this seems inelegant to me.