I would send him this email using myyour corporate email address:
If you have a script notifying you of other employee's purchases, that is not ok. And even if you don't have such a script, or if your script was for debugging purpose, your message to me was still not appropriate either way.
Do you understand what I'm saying? Please respond to let me know that you understand.
Obviously, use your own words.
If he still ignores your concern, or doesn't acknowledge the fact that he made a mistake, then threaten to bring this up to HR or to his supervisor.
This needs to be nipped in the bud right away. I understand that he's your friend, but if he doesn't understand the line he's crossed, he's going to cross it with someone else who isn't going to be as understanding.
Remember that Google employee who got fired for breach of privacy. I'm sure that he wish that a coworker had knocked some sense into him before he lost his job.