If it was a serious or sad situation you may also choose to be more formal. For example, you might write to express your condolences rather than send a hug by text to the family of someone who has ...