FIX: Email substution bug (PR #13641)

TODO: Currently, this is only the failing test, not the fix.

GitHub

Update: Culprit is somewhere in Email::MessageBuilder.new(...).html_part

Debugging this was a miserable swamp of “single” stepping through ActionMailer and discovering that the email had already been fully rendered.

The title of this pull request changed from “DEV: Commit failing test for email substution bug” to "FIX: Email substution bug

Great find!

Would it be better to just change the { capture { yield } } part? I assume tmp stuff was just for debugging purposes?

Done

This pull request has been mentioned on Discourse Meta. There might be relevant details there: