Fork from Tansarc_EmailTemplateAdapter