@@ -85,26 +85,25 @@ def send_notification(subject, recipients, html, mailtype='', files=None):
8585 print (f'\n { html } \n ' )
8686 print ('-' * 22 , 'EMAIL END -' , '-' * 22 )
8787
88- # If it's not PROD only able to use test e-mail addresses which are set in the env var
8988 to_addresses = recipients if isinstance (recipients , list ) else [recipients ]
9089
91- if not IS_PROD :
92- logger .info ('Using test email addresses...' )
93- to_addresses = []
94- logger .info (to_addresses )
95- for eml in settings .TEST_EMAILS :
96-
97- # It is possible to filter test addressees to domain name only – not used.
98- is_dom = True if '@' not in eml else False
99- if is_dom :
100- for rec in recipients :
101- try :
102- if eml == rec .split ('@' )[1 ]:
103- to_addresses .append (rec )
104- except Exception :
105- logger .info ('Could not extract domain from: {}' .format (rec ))
106- elif eml and (eml in recipients ):
107- to_addresses .append (eml )
90+ # if not IS_PROD:
91+ # logger.info('Using test email addresses...')
92+ # to_addresses = []
93+ # logger.info(to_addresses)
94+ # for eml in settings.TEST_EMAILS:
95+ #
96+ # # It is possible to filter test addressees to domain name only – not used.
97+ # is_dom = True if '@' not in eml else False
98+ # if is_dom:
99+ # for rec in recipients:
100+ # try:
101+ # if eml == rec.split('@')[1]:
102+ # to_addresses.append(rec)
103+ # except Exception:
104+ # logger.info('Could not extract domain from: {}'.format(rec))
105+ # elif eml and (eml in recipients):
106+ # to_addresses.append(eml)
108107
109108 recipients_as_string = ',' .join (to_addresses )
110109 if not recipients_as_string :
0 commit comments