As far as I know there is no way to place text on top of an attached image in Mail.
When you click on an image attached to Mail, the image is selected; when you then type in new text, the text replaces the image, just as it would replace any selected text.
You can add background color, set font face, style, and color for selected text, and do some other standard text formatting things.
But, Mail is not a word processor nor a page layout program. There is no word wrap-around for embedded (attached) images, nor the ability to layer text on top of such an image.
If you want to have text on top of an image, do that in another program (Preview or Pages, for example, depending on the complexity) and then attach the resulting composite to the email.
How it was done for the predefined templates is something I have not been able to replicate.