Pošljite SMS: The quasi-geostrophic theory of the thermal shallow water equations