[tor-commits] [bridgedb/develop] Remove silly email footer.

phw at torproject.org phw at torproject.org
Mon Apr 6 22:42:56 UTC 2020


commit bcfe39f5f04adfed266490e523fe6d5e9b585047
Author: Philipp Winter <phw at nymity.ch>
Date:   Fri Mar 27 13:16:01 2020 -0700

    Remove silly email footer.
---
 bridgedb/distributors/email/templates.py | 43 --------------------------------
 bridgedb/test/test_email_templates.py    | 10 --------
 2 files changed, 53 deletions(-)

diff --git a/bridgedb/distributors/email/templates.py b/bridgedb/distributors/email/templates.py
index 570341a..d618c37 100644
--- a/bridgedb/distributors/email/templates.py
+++ b/bridgedb/distributors/email/templates.py
@@ -102,45 +102,8 @@ def addHowto(template):
     howToTBB += u'\n\n'
     return howToTBB
 
-def addFooter(template, clientAddress=None):
-    """Add a footer::
-
-        --
-        <3 BridgeDB
-       ________________________________________________________________________
-       Public Keys: https://bridges.torproject.org/keys
-
-       This email was generated with rainbows, unicorns, and sparkles
-       for alice at example.com on Friday, 09 May, 2014 at 18:59:39.
-
-
-    :type template: ``gettext.NullTranslation`` or ``gettext.GNUTranslation``
-    :param template: A gettext translations instance, optionally with fallback
-        languages set.
-    :type clientAddress: :api:`twisted.mail.smtp.Address`
-    :param clientAddress: The client's email address which should be in the
-        ``To:`` header of the response email.
-    """
-    now = datetime.utcnow()
-    clientAddr = clientAddress.addrstr
-
-    footer  = u' --\n'
-    footer += u' <3 BridgeDB\n'
-    footer += u'_' * 70
-    footer += u'\n'
-    footer += template.gettext(strings.EMAIL_MISC_TEXT[8])
-    footer += u': https://bridges.torproject.org/keys\n'
-    footer += template.gettext(strings.EMAIL_MISC_TEXT[9]) \
-              % (clientAddr,
-                 now.strftime('%A, %d %B, %Y'),
-                 now.strftime('%H:%M:%S'))
-    footer += u'\n\n'
-
-    return footer
-
 def buildKeyMessage(template, clientAddress=None):
     message  = addKeyfile(template)
-    message += addFooter(template, clientAddress)
     return message
 
 def buildWelcomeText(template, clientAddress=None):
@@ -159,8 +122,6 @@ def buildWelcomeText(template, clientAddress=None):
     message  = u"\n\n".join(sections)
     # Add the markdown links at the end:
     message += strings.EMAIL_REFERENCE_LINKS.get("WELCOME0")
-    message += u"\n\n"
-    message += addFooter(template, clientAddress)
 
     return message
 
@@ -171,8 +132,6 @@ def buildAnswerMessage(template, clientAddress=None, answer=None):
         message += addHowto(template)
         message += u'\n\n'
         message += addCommands(template)
-        message += u'\n\n'
-        message += addFooter(template, clientAddress)
     except Exception as error:  # pragma: no cover
         logging.error("Error while formatting email message template:")
         logging.exception(error)
@@ -187,8 +146,6 @@ def buildSpamWarning(template, clientAddress=None):
         message += u"\n\n"
         message += template.gettext(strings.EMAIL_MISC_TEXT[2]) \
                    % str(MAX_EMAIL_RATE / 3600)
-        message += u"\n\n"
-        message += addFooter(template, clientAddress)
     except Exception as error:  # pragma: no cover
         logging.error("Error while formatting email spam template:")
         logging.exception(error)
diff --git a/bridgedb/test/test_email_templates.py b/bridgedb/test/test_email_templates.py
index 4703019..1d55dd9 100644
--- a/bridgedb/test/test_email_templates.py
+++ b/bridgedb/test/test_email_templates.py
@@ -54,9 +54,6 @@ class EmailTemplatesTests(unittest.TestCase):
     def shouldIncludeKey(self, text):
         self.assertSubstring('-----BEGIN PGP PUBLIC KEY BLOCK-----', text)
 
-    def shouldIncludeFooter(self, text):
-        self.assertSubstring('rainbows, unicorns, and sparkles', text)
-
     def test_templates_addCommands(self):
         text = templates.addCommands(self.t)
         self.shouldIncludeCommands(text)
@@ -90,16 +87,11 @@ class EmailTemplatesTests(unittest.TestCase):
         text = templates.addBridgeAnswer(self.t, self.answer)
         self.shouldIncludeBridges(text)
 
-    def test_templates_addFooter(self):
-        text = templates.addFooter(self.t, self.client)
-        self.shouldIncludeFooter(text)
-
     def test_templates_buildAnswerMessage(self):
         text = templates.buildAnswerMessage(self.t, self.client, self.answer)
         self.assertSubstring(self.answer, text)
         self.shouldIncludeAutomationNotice(text)
         self.shouldIncludeCommands(text)
-        self.shouldIncludeFooter(text)
 
     def test_templates_buildKeyMessage(self):
         text = templates.buildKeyMessage(self.t, self.client)
@@ -110,10 +102,8 @@ class EmailTemplatesTests(unittest.TestCase):
         self.shouldIncludeGreeting(text)
         self.assertSubstring('Welcome to BridgeDB!', text)
         self.shouldIncludeCommands(text)
-        self.shouldIncludeFooter(text)
 
     def test_templates_buildSpamWarning(self):
         text = templates.buildSpamWarning(self.t, self.client)
         self.shouldIncludeGreeting(text)
         self.shouldIncludeAutomationNotice(text)
-        self.shouldIncludeFooter(text)





More information about the tor-commits mailing list