Fix mail template replacements