Sorry for your loss.
Were you close to your cousin?
Not that it excuses the message, but if this was a cousin you saw all the time, were very involved with and close to, then to find out in such a way is horrendous. He should have thought that it is important to deliver the news of the death of a loved one in the right way.
If, otoh, it was a cousin you never saw from year end to year end and didn't really know, iyswim, then it was inappropriate perhaps to deliver news that way but not horrible, iyswim. He may not have thought you would be devastated by the news of the death of someone you don't know.