support urlEncoded subject
This commit is contained in:
@@ -179,12 +179,14 @@ class MailReader():
|
|||||||
body = body + part.get_payload(decode=True).decode("utf-8")
|
body = body + part.get_payload(decode=True).decode("utf-8")
|
||||||
elif part.get_content_type() == "text/plain":
|
elif part.get_content_type() == "text/plain":
|
||||||
body = body + part.get_payload()
|
body = body + part.get_payload()
|
||||||
if VALIDATION_URL_SUBJECT_fr in subject or VALIDATION_URL_SUBJECT_EN in subject:
|
if VALIDATION_URL_SUBJECT_fr in subject or VALIDATION_URL_SUBJECT_EN in subject or "Validation=20de=20votre=20demande=20de=20rendez-vous" in subject:
|
||||||
mail = MailPojo(subject=subject, body=body, from_address=from_address)
|
mail = MailPojo(subject=subject, body=body, from_address=from_address)
|
||||||
mail.isImapClient = True
|
mail.isImapClient = True
|
||||||
print("email is {}".format(self.login))
|
print("email is {}".format(self.login))
|
||||||
print("body is {}".format(body))
|
print("body is {}".format(body))
|
||||||
print("subject is {}".format(subject))
|
print("subject is {}".format(subject))
|
||||||
|
if len(mail.to_address) == 0:
|
||||||
|
mail.to_address = self.login
|
||||||
mail_messages.append(mail)
|
mail_messages.append(mail)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
print(error)
|
print(error)
|
||||||
|
|||||||
Reference in New Issue
Block a user