Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Fantastic answer, +1, but I have to agree with @usr1234567. If your managers are "barely out of their teenage years", then they will behave that way. The young managers will likely consider "put it in writing" to be an escalation, and could make OP's job much worse moving forward.
If the OP still has this person's personal contact info, he could reach out directly and call them out on their stupid stunt. Perhaps the OP will get a well-deserved apology. But potentially sabotaging their new job over a misguided "prank" may be a bit of an overreach.
+1 for "keep it private". Unless there are legal concerns, there's no reason to mention it to anyone beside your boss. I'd pick the boss that you have a better relationship with, and quietly pull them aside (verbally, if possible).
Side note... If you choose to speak with your boss, keep an open mind about what is actually going on. There is a chance that you made some false assumptions about his recent change in behavior, and the root cause might actually be something else entirely.
This answer is spot on. Don’t be embarrassed that it happened, be happy that you caught it in time. I don’t know what kind of industry this is, but it’s possible the cost of fixing it now might pale in comparison to how much they could have lost. Listen to Gregory Currie, focus on the solution, not the problem. If you’re already invested in making things right, then you’re doing the right thing.
@MathijsSegers Yes, transfer of knowledge is (at least partially) the OP's responsibility. But that wasn't really the issue... he's worried about leaving the company at all.
If I quit, my biggest concern... leaving my team hanging - Go read up on the bus factor, and understand that it's not your responsibility to make sure your chair is always occupied.
My general rule of thumb when writing an email... if I want a response, I make sure there's a question in there (ie: something that ends with a question mark). If there is no question, then you have not been prompted to respond.