Imprints of mass accretion history on the shape of the intracluster medium and the TX–M relation | Synapse