I told my family immediately. Close friends I told as I saw them in person or if they lived far away I sent a text or called.
My best friend and I always joke about my lifelong desire to be barefoot, pregnant and in the kitchen. I took a picture of me barefoot and in the kitchen and said "Not just two out of three anymore!". He got it immediately.
I think it would be pretty easy to send out a mass text like that.
For the rest, I posted an ultrasound picture on facebook with a silly "your mom" joke. It's already pretty obvious when I go to parties and stuff.
I know a lot of people wait until the first trimester is over, or until the scan is good.
I am, unfortunately, very aware of my grieving processes for other deaths in my life. I knew if I miscarried I would need the support and love of those people. Our rule was that I wouldn't tell anyone early on that I wouldn't want to hold my hand while I cried if something went wrong.