There are bugs in the code, and gaps in the documentation, but nonetheless I figured out how to do it. (I'm using version 2.7, but the problems surrounding this seem to still exist.)
in ~/moodle/lang/en/moodle.php they define $string['newusernewpasswordtext']
What you need to do is copy that definition to a file called ~/moodledata/lang/en_local/moodle.php . (See the bottom of this message if this file does not current exist.) Then edit that definition to make it the way you want it.
Then you have to purge the cache to see the effect of your changes. To do this, use the menu on this path:
Site Administration / Development / Purge all caches
( see this page for more details https://docs.moodle.org/27/en/Purge_all_cache )
Some of the documentation suggests doing this kind of change using the feature under languages that lets you edit all the strings used in the entire system. This does not work because, as somebody noted above, the strings are stripped of all newlines and strings of blanks before you can edit them. So if you use this method, the email looks completely wrong, and is basically unreadable. That's why I did it as described above.
Actually, you should probably first make some change using the feature under languages. Then the file ~/moodledata/lang/en_local/moodle.php will be created for you with the correct preamble.