def METHOD_NAME(body, **kw):
    """Convert the given body template to a text/plain type MIME document
    :param body: The email body text or template
    :type body: basestring
    :returns: MIMEText
    """
    body_template = Template(safe_unicode(body)).safe_substitute(**kw)
    subtype = "plain"
    # Allow to send HTML messages
    # https://docs.python.org/2/library/email-examples.html#id5
    if kw.get("html", False):
        subtype = "html"
    return MIMEText(body_template, _subtype=subtype, _charset="utf8")