Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3691474
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:09:07+00:00 2026-05-19T04:09:07+00:00

I want to substitute build-in send_mail function, that works only with plain-text emails, with

  • 0

I want to substitute build-in send_mail function, that works only with plain-text emails, with my own smart send_mail function, that generates both html and plain-text versions automatically. Everything works as expected for my own emails, defined in my own application. I can do it in views.py in this fashion:

from django.core import mail
from utils import send_mail as send_html_mail
mail.send_mail = send_html_mail

But the problem still appears with emails of third-side applications. There all imports already completed before my code with monkey-patching of send_mail function.

Is it possible to override this function before all imports of all django applications? Or may be there is another solution of this issue. I really don’t want to patch code with sending emails of these third-party applications. It’s much easy just to put html-template.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:09:07+00:00Added an answer on May 19, 2026 at 4:09 am

    I wrote application for quickly switching from plain-text emails to html based emails for all project’s applications. It will work without modifying any Django code or code of other third-part applications.

    Check it out here: https://github.com/ramusus/django-email-html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to substitute all white space that precedes the class [A-Za-z0-9_] , with
I want to substitute a certain filed of the text while keeping the same
Theres is a little problem I want to solve with Haskell: let substitute a
I want to loop over the contents of a text file and do a
I want to make an etag that matches what Apache produces. How does apache
I want to substitute a variable in oracle . The var is coming in
$var = 'about/'; $var =~ s/^(.*)\/?$/index.php?action=$1/; I want it to match and substitute the
I want to substitute all cygdrive/e with cygdrive/d using vim. But I can't get
I want to substitute all occurences of string in a file as follows :
I have the expression D[f[x, y], x] , and I want to substitute f[x,y]

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.