How to switch between sending and logging email ?

I have site in production and I’m using EmailMultiAlternatives and EmailMessage to send emails.
Sometimes I add new or update existing email sending procedures or templates.
Then I don’t want to bother client with getting test emails so I change email settings to send from test SMTP sender and after testing I change email settings back to default STMP sender.
But this is very annoying to do every time so…

Is there an easy way to switch from sending emails to logging only without changing other code and settings ?

Here is example how my sending mail functions look like:

def send_email_newsletter_subscriber_created(newsletter_subscriber_id):
    # prepare all needed info...
    msg = EmailMultiAlternatives(subject=subject, body=text_content, to=[to]) 
    msg.attach_alternative(html_content, "text/html")
	# add images, prepare some other info...

def send_email_contact_message_created(contact_message_id):
    # prepare all needed info...
    msg = EmailMessage(subject=subject, body=text_content, to=[to], headers={'Content-Type': 'text/plain'},) 

I’m guessing you are looking for something to change the email backend based upon (perhaps) some “switch setting” in your database.

This can be done by implementing a custom email backend that would check that custom setting and select from the “real” backend to use for each email request.

If you want some ideas, take a look at GitHub - tbarbugli/django_email_multibackend: django_email_multibackend