“Actually, this is funny: Miranda Lambert heard the song before Meghan even had a record deal because my sister-in-law is married to Miranda’s personal trainer. Miranda heard the song over a year ago. And then when it came to the CMA’s, she was like, ’Oh! Let’s do that song.’ So it’s kind of full circle.”

And by the way, how did a 43-year-old man write a song that every single teenage girl (OK, every single person with a pulse) has stuck in her head?

“Maybe I’m just in touch with my feminine side,” he said, adding the songwriting session with Trainor was very organic. “We weren’t acting like professional songwriters. We were just writing a song to write a song. We were just being creative and, honestly, we never thought this song would be on the radio. We never thought anyone would hear the song.”

Why are those songs — the ones written without any commercial intentions — usually the best ones?