def add_by_email():
recipient = request.form['to']
if '<' in recipient:
recipient = recipient.split('<')[1][:-1]
This is the code being used to get the recipient of the email. When someone emails something to Lurnby and there is more than a single email in the request.form['to'] then the function fails as it isn't pulling out the right email.
A better solution would likely be to use regex to pull out the email that has @add-article.lurnby.com as the ending.
This is the code being used to get the recipient of the email. When someone emails something to Lurnby and there is more than a single email in the
request.form['to']
then the function fails as it isn't pulling out the right email.A better solution would likely be to use regex to pull out the email that has
@add-article.lurnby.com
as the ending.