@@ -65,7 +65,7 @@ def getResume(id):
65
65
database .resume_vault .download_item (id , os .path .join (os .path .join (app .root_path , app .config ['FILE_UPLOADS' ]), id + str ('.pdf' )))
66
66
del_thread = threading .Thread (target = delay_delete , args = (5 , os .path .join (os .path .join (os .path .join (app .root_path , app .config ['FILE_UPLOADS' ]), id + str ('.pdf' )))))
67
67
del_thread .start ()
68
- return flask .send_from_directory (directory = os .path .join (app .root_path , app .config ['FILE_UPLOADS' ]), filename = id + str ('.pdf' ))
68
+ return flask .send_from_directory (directory = os .path .join (app .root_path , app .config ['FILE_UPLOADS' ]), filename = id + str ('.pdf' ))
69
69
70
70
def delay_delete (t , path ):
71
71
print ("started" )
@@ -201,25 +201,28 @@ def getJobStats(jobid):
201
201
# @flask_login.login_required
202
202
def sendEmails ():
203
203
# print(flask.request.json['emails'])
204
- mailList = flask .request .json ['emails' ]
205
- for mail in mailList :
206
- MAIL_USER_ID = "[email protected] "
207
- SUBJECT = "Level Up!"
208
- server = smtplib .SMTP ('smtp.gmail.com' , 587 )
209
- server .ehlo ()
210
- server .starttls ()
211
- server .login (MAIL_USER_ID , GMAIL_PWD )
212
-
213
- TEXT = "Congratulations! You have made it to the next round of interviews. We, at Blueprint, are eagerly looking forward to meet you."
214
-
215
- BODY = '\r \n ' .join (['To: %s' % mail ,
216
- 'From: %s' % MAIL_USER_ID ,
217
- 'Subject: %s' % SUBJECT ,
218
- '' , TEXT ])
219
-
220
- server .sendmail (MAIL_USER_ID , [mail ], BODY )
221
- print ('chat mailed' )
222
- return 'ok'
204
+ try :
205
+ mailList = flask .request .json ['emails' ]
206
+ for mail in mailList :
207
+ MAIL_USER_ID = "[email protected] "
208
+ SUBJECT = "Level Up!"
209
+ server = smtplib .SMTP ('smtp.gmail.com' , 587 )
210
+ server .ehlo ()
211
+ server .starttls ()
212
+ server .login (MAIL_USER_ID , GMAIL_PWD )
213
+
214
+ TEXT = "Congratulations! You have made it to the next round of interviews. We, at Blueprint, are eagerly looking forward to meet you."
215
+
216
+ BODY = '\r \n ' .join (['To: %s' % mail ,
217
+ 'From: %s' % MAIL_USER_ID ,
218
+ 'Subject: %s' % SUBJECT ,
219
+ '' , TEXT ])
220
+
221
+ server .sendmail (MAIL_USER_ID , [mail ], BODY )
222
+ print ('chat mailed' )
223
+ return 'ok'
224
+ except Exception as e :
225
+ return str (e )
223
226
224
227
@app .route ('/logout' )
225
228
def logout ():
0 commit comments