What are the problems with my design for email NEM application?

Just for fun (and to learn a little bit about NEM) I want to build the following application:

It listens to my NEM account and whenever a new transaction is sent to me, it waits will this transaction gets 6 confirmations and after this the application sends me an email.

After reading documentation, here are my thoughts how to do this:

  1. Run NIS on some server
  2. Run my application on the same server
  3. Create a set of finished transactions.
  4. Every 60 seconds call:
    1. /chain/height API to find the current height.
    2. /account/transfers/incoming API and grab the transactions. If the transaction is not in the set of finished transactions, check whether its current height - height >= 6. If so, send the email with details and add it to the finished set.

This looks reasonable, but I do not think that this is the best approach. What if I get more than 25 tx before I get the confirmation number 6? I would rather call transfers/incoming every second, add the new transactions to the below_6_confirmations set and than for every such transaction check whether it has enough confirmations (but I have not seen such API).

Basically I am asking more experienced people: how would you approach this situation (also is this the right place to ask such questions)?

Check out the node.js nem sdk by QM. You don’t have to worry about a nis server as you can poll the current supernodes automatically. You can also have your script poll the transfers and save to a db or flat file.
If you need more pointers let me know and I can drop in a sample script.
Also, for the transactions, you can just send the hash of the last transactions you recorded and get everything before that the 25 limit is a bit arbitrary.