@@ -135,7 +135,7 @@ def send_email_smtp(
135135 #return files
136136 #data["attachments"] = files
137137 except Exception as e :
138- print (f"Error in attachment parsing for email: { e } " )
138+ self . logger . info (f"Error in attachment parsing for email: { e } " )
139139
140140
141141 try :
@@ -146,7 +146,7 @@ def send_email_smtp(
146146 "reason" : f"Failed to send mail: { e } "
147147 }
148148
149- print ("Successfully sent email with subject %s to %s" % (subject , recipient ))
149+ self . logger . info ("Successfully sent email with subject %s to %s" % (subject , recipient ))
150150 return {
151151 "success" : True ,
152152 "reason" : "Email sent to %s!" % recipient ,
@@ -241,11 +241,11 @@ def merge(d1, d2):
241241 if id_list == None :
242242 return {
243243 "success" : False ,
244- "reason" : "Couldn't retrieve email. Data: %s" % data ,
244+ "reason" : f "Couldn't retrieve email. Data: { data } " ,
245245 }
246246
247247 try :
248- print ( "LIST: " , len ( id_list ) )
248+ self . logger . info ( f "LIST: { id_list } " )
249249 except TypeError :
250250 return {
251251 "success" : False ,
@@ -274,7 +274,7 @@ def merge(d1, d2):
274274 if len (id_list ) == 0 :
275275 return {
276276 "success" : True ,
277- "emails" : json . dumps ( emails , default = default ) ,
277+ "emails" : [] ,
278278 }
279279
280280 try :
@@ -283,7 +283,7 @@ def merge(d1, d2):
283283 error = None
284284
285285 if resp != "OK" :
286- print ("Failed getting %s" % id_list [i ])
286+ self . logger . info ("Failed getting %s" % id_list [i ])
287287 continue
288288
289289 if data == None :
0 commit comments