If attached file exist
This commit is contained in:
parent
d1a22548cd
commit
d18bd817fd
|
|
@ -68,10 +68,11 @@ class ThreadMaileur():
|
||||||
)
|
)
|
||||||
mail.attach_alternative(self.html, "text/html")
|
mail.attach_alternative(self.html, "text/html")
|
||||||
|
|
||||||
for filename, url in self.urls_for_attached_files.items():
|
if self.urls_for_attached_files:
|
||||||
response = requests.get(url)
|
for filename, url in self.urls_for_attached_files.items():
|
||||||
if response.status_code == 200:
|
response = requests.get(url)
|
||||||
mail.attach(filename, response.content, 'application/pdf')
|
if response.status_code == 200:
|
||||||
|
mail.attach(filename, response.content, 'application/pdf')
|
||||||
|
|
||||||
mail_return = mail.send(fail_silently=False)
|
mail_return = mail.send(fail_silently=False)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue