emails overhaul

lots of changes tested locally by both @jkooms and I.