Currently, when something builds a PhabricatorMetaMTAMail, it must call both setBody() and setHTMLBody() to separately pass the body and HTML body. However, only some callsites do this. This causes some issues:
- Some mail doesn't send with an HTML body, even if the user has requested HTML mail and we have an HTML body available.
- After D10857, some mail generates with an empty HTML body, then has a To/CC footer appended. This can result in users receiving only the To/Cc part mail. A specific example of this is the mail generated by PhabricatorRepositoryPushMailWorker. (This only affects some mail, and only users who have opted into HTML mail, so it's not quite as broken as the screenshot looks.)
To remedy this, we should:
- Add some setMailBody() method which accepts a PhabricatorMetaMTAMailBody object and calls setBody() + setHTMLBody() from it.
- Maybe rename setBody() + setHTMLBody() to setRawBody() + setRawHTMLBody().
- When adding the To/Cc HTML, maybe make sure the mail already has an HTML body, so we never end up with a body that only has to/cc.
- Go through all new PhabricatorMetaMTAMail() callsites and make sure they set HTML bodies if one is available.