def METHOD_NAME(template, values):
    from app.models import EMAIL_TYPE, LETTER_TYPE, SMS_TYPE
    return {SMS_TYPE: SMSMessageTemplate, EMAIL_TYPE: WithSubjectTemplate, LETTER_TYPE: WithSubjectTemplate}[
        template["template_type"]
    ](template, values)