This is a good example of a text to send to your future wife. A quick google search comes up with numerous hits all bearing the same message. It's generic.
A good tip is to make the text personal to the both of you. Something that doesn't scream copy&paste, whether that be sexual or not. It's always good to end an interaction with her thinking about you however it's not the end of the world if you don't.
"Don't you dare have filthy dreams about me" is a good example by Hunter_Foxe as it very relivant to the pair of you. It's also funny. Using humour relivant to you both can be a great way to end goodnight.
For example, a girl in my class loves the smell of fresh books. I ended the conversation one night with: 'Goodnight ms. Granger, try not to dream too much about floating books

'. The reference being to Harry Potter, she's a fan. That morning the interaction continue with a text sent by me saying: 'What have you done to me?? I woke up dreaming about library. That's it, I'm cutting the time I spend with you!' It worked well as it was personal to her and also to the conversation and jokes we were having during our time together.
That being said a general rule is to not to overthink it too much. At the end of the day it is just a good night text. Keeping it simple can work very much in your favour. Even a playful 'Goodnight cutie' can work wonders.
- Kang