The “Markdown Mail” information in the Mail integration guide should answer most of that…start there.