Skip to content
This repository was archived by the owner on May 25, 2022. It is now read-only.

Commit bb44726

Browse files
committed
Update app.py
1 parent 89dd904 commit bb44726

File tree

1 file changed

+23
-20
lines changed

1 file changed

+23
-20
lines changed

app.py

+23-20
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def getResume(id):
6565
database.resume_vault.download_item(id, os.path.join(os.path.join(app.root_path, app.config['FILE_UPLOADS']), id+str('.pdf')))
6666
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')))))
6767
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'))
6969

7070
def delay_delete (t, path):
7171
print ("started")
@@ -201,25 +201,28 @@ def getJobStats(jobid):
201201
# @flask_login.login_required
202202
def sendEmails():
203203
# 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)
223226

224227
@app.route('/logout')
225228
def logout():

0 commit comments

Comments
 (0)