@@ -0,0 +1,978 @@
+import webbrowser%0Afrom tempfile import NamedTemporaryFile%0A%0Afrom django.conf import settings%0Afrom django.core.mail.backends.base import BaseEmailBackend%0A%0A%0Aclass BrowsableEmailBackend(BaseEmailBackend):%0A    %22%22%22%0A    An email backend that opens HTML parts of emails sent%0A    in a local web browser, for testing during development.%0A%0A    Adapted from https://github.com/stephenmcd/django-email-extras%0A    %22%22%22%0A    def send_messages(self, email_messages):%0A        # Should never be used in production.%0A        if not settings.DEBUG:%0A            return%0A%0A        for message in email_messages:%0A            alternatives = getattr(message, 'alternatives', %5B%5D)%0A%0A            for body, content_type in alternatives:%0A                if content_type == 'text/html':%0A                    self.open(body.encode('utf-8'))%0A%0A    def open(self, body):%0A        temp = NamedTemporaryFile(delete=False)%0A        temp.write(body)%0A        temp.close()%0A%0A        webbrowser.open('file://%7B%7D'.format(temp.name))%0A

Implement BrowsableEmailBackend