FIX: Email substution bug (PR #13641)

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


Update: Culprit is somewhere in

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?


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