Fix template open

This commit is contained in:
Cyril Novel 2020-08-30 14:41:39 +02:00
commit f32147c25a

View file

@ -6,6 +6,7 @@ from smtplib import SMTP_SSL
from argparse import ArgumentParser
from datetime import date, timedelta
import wikiquote
import os
from event import create_events_from_span
@ -78,7 +79,9 @@ class EmailSender:
def create_html_templated(events_previous, events_current, events_next):
with open('../html_template/mail.html', 'r', encoding='utf-8') as tmp:
directory = os.path.dirname(os.path.realpath(__file__))
template_path = os.path.join(directory, '..', 'html_template', 'mail.html')
with open(template_path, 'r', encoding='utf-8') as tmp:
mail = tmp.read()
mail = mail.replace('{LogoAddress}',
'http://xerto.free.fr/Paturlettre/LogoLettre.png')