HOA's are getting into deep trouble these days for not following notification procedures to all interested parties. I would specifically contact the HOA which foreclosed and verify what notification methods were used to inform ALL interested parties. Please understand HOA's also "lawyer up" when approached on this subject. Most cooperate and request that you submit something in writing to describe your request. Either way, make sure it's certified mail. The response you're looking for is: "yes, the HOA sent certified mail to the correct lender holding the note, and the letter was sent on xxxx date, and the HOA advertised in a local periodical in the legal notices section with regards to the imminent foreclose to happen"...etc., etc. sometimes HOA's have in house lawyers who will "pass the buck" to the legal firm who in fact handled the foreclosure admin.
Should the bank show up one day and say..."xyz bank was never informed of such foreclosure proceedings...", you 'll have some documentation with your own real estate attorney to argue your case.
I want to add this is my opinion and not advice that would replace legal counsel given by an attorney. I am not a licensed attorney, but instead speaking to experiences in my local market. Always consult with legal counsel in your local market for the best option(s) available to your circumstances /situation.
Hope this helps and I hope you don't have to go through any headaches.