“What prompted you to contact me?”
Your ex-boyfriend called you and invited you to have coffee together. Now you're sitting with him. You want to know why he called and invited you out.
What prompted you to contact me?
Want Video and Sound? Follow us on YouTube
contact (someone)
To "contact" someone means to call, email, or send a letter to them. Those words are all specific, but "contact" can mean all three.
In more casual speech, the phrase "get in touch with ___" can be used to mean "contact ___".
What prompted (someone) to (do something)?
You can ask "What prompted you to ___?" to find out why someone did something. Specifically, you're asking what event made the person decide to start doing that action.
For example, here's a short conversation:
A: So what prompted you to look for a new job after all of these years working there?
B: Well, they just hired a new manager, who is totally incompetent. I couldn't stand it any longer.
"What prompted you to ___?" is also a little more formal than asking "Why did you ___?"