こんにちは (Konnichiwa) ClaudiaR27,
I hope your aquaintances are doing okay after the earthquakes - it was pretty awful!
To ask about their wellfare, you might say 最近の地震はご無事でしたか? (Jishin wa gobuji deshita ka?) “Were (you) safe from the recent earthquakes?" (literally, “As for recent earthquake, was safe?”).
無事でしたか? (Buji deshita ka?) means “Were (you) safe?” 無事 (Buji) is the noun for “safety”; it's similar to 安全 (anzen) “safety," only it's used after an event has occured (e.g. a natural disaster) to inquire about someone's wellbeing. The honorific particle ご (go) is often added before it to make it polite.
Tony-S10, your sentence is gramatically correct; however, to make it sound a little more natural you might add change なので (nanode) to があったので (ga atta node) and 皆に (minna ni) to 皆のことに (minna no koto ni):
最近地震があったので皆のことにお祈りしています。
Saikin jishin ga atta no de minna no koto ni oinori shiteimasu.
"(I) am praying for everyone's safety because of the recent earthquakes."
Literally, this means “Because there was earthquake recently, praying for everyone's thing.”
Using 皆のことに (minna no koto ni) sounds a little more thoughtful, since it covers not just the people directly impacted but also those who might be indirectly affected or concerned about the situation.
I hope this helped!
勉強を頑張ってください! (Benkyō o ganbatte kudasai!)