code: def send_mail_template(subject, template, addr_from, recipient_list,
                         fail_silently=False, attachments=None, context=None,
                         connection=None, headers=None):
      
  
      if context is None:
          context = {}
  
      # Loads a template passing in vars as context.
      def render(ext):
          name = "email_extras/%s.%s" % (template, ext)
          return loader.get_template(name).render(context)
  
      send_mail(subject, render("txt"), addr_from, recipient_list,
                fail_silently=fail_silently, attachments=attachments,
                html_message=render("html"), connection=connection,
                headers=headers)
docs: Send email rendering text and html versions for the specified
      template name using the context dictionary passed in.