It is not good to do it via email, unless there was 'no-way' to send a card.
I am a big believer in good manner, and the loss of a loved one or friend ect, is not something that should be done I feel, without a card.
A sign of respect you went out of your way, and sent the card.
If you can't get one...for whatever reason (e.g. Poor health).
Then yes there are some lovely ones on line, or even Google.
(make sure you express also your reason if by email).
Text is o.k., but should be followed with a card also.(not just a text).
I think it is a generation thing, and as such I tend to send a card to elderly friends and relatives but younger folks I would email, or contact through Facebook. I don't think I've ever sent condolences by text but I have received several this last week, which surprised me, and what prompted the question!
I quite often also send flowers or some other little gift with a note, rather than the traditional card.