Readd some missing code for email during merge