def send_email(recipient, subject, template, template_html, context=None, request=None):
    '\n    Send multipart email\n\n    recipient\n        Email recipient address\n\n    subject\n        Email subject header\n\n    template\n        Plain text template to send\n\n    template_html\n        HTML template to send as new message part\n\n    context\n        A dictionary to pass into the template calls\n\n    request\n        Request object for determining absolute URL\n    '
    if request:
        scheme = ('https' if request.is_secure() else 'http')
        context['uri'] = '{scheme}://{host}'.format(scheme=scheme, host=request.get_host())
    ctx = {}
    ctx.update(context)
    msg = EmailMultiAlternatives(subject, get_template(template).render(ctx), settings.DEFAULT_FROM_EMAIL, [recipient])
    msg.attach_alternative(get_template(template_html).render(ctx), 'text/html')
    msg.send()
Send multipart email

recipient
    Email recipient address

subject
    Email subject header

template
    Plain text template to send

template_html
    HTML template to send as new message part

context
    A dictionary to pass into the template calls

request
    Request object for determining absolute URL
def send_email(recipient, subject, template, template_html, context=None, request=None):
    '\n    Send multipart email\n\n    recipient\n        Email recipient address\n\n    subject\n        Email subject header\n\n    template\n        Plain text template to send\n\n    template_html\n        HTML template to send as new message part\n\n    context\n        A dictionary to pass into the template calls\n\n    request\n        Request object for determining absolute URL\n    '
    if request:
        scheme = ('https' if request.is_secure() else 'http')
        context['uri'] = '{scheme}://{host}'.format(scheme=scheme, host=request.get_host())
    ctx = {}
    ctx.update(context)
    msg = EmailMultiAlternatives(subject, get_template(template).render(ctx), settings.DEFAULT_FROM_EMAIL, [recipient])
    msg.attach_alternative(get_template(template_html).render(ctx), 'text/html')
    msg.send()