
Another vote for the windchime method here, or maybe a bell?
I'm having housetraining issues with two of mine at the moment, and TBH I wouldn't recommend a dog flap for a youngster that's still learning where he/she should go. Those two grew up with a dogflap, never made a mess inside the house. Now, I don't have one, and almost every night they are making a mess - one makes no effort at all to let me know, she just goes at night. The other whines briefly, it doesn't always wake me up (this is first thing in the morning) and he goes in the front room. Sometimes he won't even warn.
They've gotten used to being able to go when they wanted, so now I'm about to start teaching them to signal using a bell. I will also generalise it to upstairs - Remy sleeps on the bed and I wouldn't wake up if he rang it downstairs.
One other thing, blocking access to typical mess spots seems to help - mine tend to go in the front room, so if I shut the door at night it definitely helps. Not always, but most of the time.