My business has a new problem. We have a set amount of licenses for taking an online exam. The license serial numbers and access codes are all set already (they are not going to be generated live). I need a way to send an email containing the unique license information automatically when a payment is received. The problem is that once a license is sent, it is "used up", and the next email has to use the next available license. I don't know how to do this. We use gmail apps for our business, but I also access it using the Bat. I'm pretty sure it's not that hard to do, but I can't figure out a way. It would have to work something like this:
1) Payment is received and my business receives the confirmation email.
2) As soon as that email is received, my business automatically sends the license email. It'll be a standard template, but the the license fields need to be pulled from an excel sheet, or csv file, or something like that.
3) Once the license email is sent, that license is not available any longer. The next license will need to be used next time. So something like a counter needs to be built into this whole system.
How can I do this? The bat has some interesting features in the quick templates, like the macro options involving cookies or attachments or something. But it's the Bat so there is no documentation, and I have no idea what it can and can't do.
How do you programmers manage your software licenses? Is there anything in what you do that I can steal? Are there software license management tools for developers that I can shoehorn into this thing?
Thanks.
I'll pay for it also, but I'd rather buy an existing system because I figure I'll spend hours fiddling around with it, and if I have to pay someone per hour, it would be expensive. We threw the idea at someone and were quoted $1500 with a delivery time of a few months. I'd like this by early April

. Any ideas are appreciated. i googled around, but the keywords make it near impossible to find anything (license, software, inventory management).