noun word-forming element, "that which is written or marked," from Greek gramma "that which is drawn; a picture, a drawing; that which is written, a character, an alphabet letter, written letter, piece of writing;" in plural, "letters," also "papers, documents of any kind," also "learning," from stem of graphein "to draw or write" (see -graphy). Some words with it are from Greek compounds, others are modern formations. Alternative -gramme is a French form.
From telegram (1850s) the element was abstracted by 1959 in candygram, a proprietary name in U.S., and thereafter put to wide use as a second element in forming new commercial words, such as Gorillagram (1979), stripagram (1981), and, ultimately, Instagram (2010). The construction violates Greek grammar, as an adverb could not properly form part of a compound noun. An earlier instance was the World War II armed services slang latrinogram "latrine rumor, barracks gossip" (1944).
<a href="https://www.etymonline.com/word/aerogram">Etymology of aerogram by etymonline</a>
Harper, D. (n.d.). Etymology of aerogram. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/aerogram