This is the 4790th most frequent Japanese word.
気がつい
"気がつい" seems to be a typo or misspelling; perhaps you meant "気がつく," which means "to notice" or "to become aware."
In this sentence, 気がついた (kigatsuita) is used to describe the act of noticing or becoming aware of something, in this case, the message. It conveys a realization or conscious awareness.
私が電車に乗っているときに彼女からのメッセージに気がついた。
I noticed the message from her while riding the train.
Here, 気がついた (kigatsuita) indicates the realization or discovery of an issue with the socks after the person had already left home. It emphasizes a retrospective awareness.
靴下が破れていることに気がついたのは、家を出た後だった。
I realized my socks had a hole in them only after leaving the house.
In this example, 気がつかなかった (kigatsukanakatta) is used to express the lack of noticing or awareness, showing that the speaker failed to realize or perceive the event of the friend's marriage.