@@ -179,10 +179,10 @@ def encode_message(txt):
179179 assert isinstance (txt , unicode )
180180 return MIMEText (txt .encode ('utf-8' ), 'plain' , 'UTF-8' )
181181
182- def send_mail_text (request , to , frm , subject , txt , cc = None , extra = None , toUser = False , bcc = None ):
182+ def send_mail_text (request , to , frm , subject , txt , cc = None , extra = None , toUser = False , bcc = None , copy = True ):
183183 """Send plain text message."""
184184 msg = encode_message (txt )
185- return send_mail_mime (request , to , frm , subject , msg , cc , extra , toUser , bcc )
185+ return send_mail_mime (request , to , frm , subject , msg , cc , extra , toUser , bcc , copy = copy )
186186
187187def formataddr (addrtuple ):
188188 """
@@ -255,7 +255,7 @@ def show_that_mail_was_sent(request,leadline,msg,bcc):
255255 info += "Bcc: %s\n " % bcc
256256 messages .info (request ,info ,extra_tags = 'preformatted' ,fail_silently = True )
257257
258- def send_mail_mime (request , to , frm , subject , msg , cc = None , extra = None , toUser = False , bcc = None ):
258+ def send_mail_mime (request , to , frm , subject , msg , cc = None , extra = None , toUser = False , bcc = None , copy = True ):
259259 """Send MIME message with content already filled in."""
260260
261261 condition_message (to , frm , subject , msg , cc , extra )
@@ -287,7 +287,7 @@ def send_mail_mime(request, to, frm, subject, msg, cc=None, extra=None, toUser=F
287287 copy_to = settings .EMAIL_COPY_TO
288288 except AttributeError :
289289 copy_to = "ietf.tracker.archive+%s@gmail.com" % settings .SERVER_MODE
290- if copy_to and not test_mode and not debugging : # if we're running automated tests, this copy is just annoying
290+ if copy and copy_to and not test_mode and not debugging : # if we're running automated tests, this copy is just annoying
291291 if bcc :
292292 msg ['X-Tracker-Bcc' ]= bcc
293293 try :
0 commit comments