diff --git a/tasks.py b/tasks.py index 69aea9b1be9da8389ce99f10898605264ddb5618..6dc8366529c90ebe8582bea84a9017ef6b010601 100644 --- a/tasks.py +++ b/tasks.py @@ -688,9 +688,10 @@ def send_protocol_public(protocol): def send_protocol_async(protocol_id, show_private): with app.app_context(): protocol = Protocol.query.filter_by(id=protocol_id).first() + next_protocol = Protocol.query.filter_by(protocoltype_id=protocol.protocoltype.id).filter_by(done=False).filter(Protocol.date > datetime.now()).order_by(Protocol.date).first() to_addr = protocol.protocoltype.private_mail if show_private else protocol.protocoltype.public_mail subject = "{}{}-Protokoll vom {}".format("Internes " if show_private else "", protocol.protocoltype.short_name, date_filter(protocol.date)) - mail_content = render_template("protocol-mail.txt", protocol=protocol, show_private=show_private) + mail_content = render_template("protocol-mail.txt", protocol=protocol, show_private=show_private, next_protocol=next_protocol) appendix = [(document.name, document.as_file_like()) for document in protocol.documents if show_private or not document.is_private diff --git a/templates/protocol-mail.txt b/templates/protocol-mail.txt index 0cb09c8dd28c8f53db8a513e6ea8f3a1222aef5f..527fb260b25ba790f84be29c1e24bf4549d2966e 100644 --- a/templates/protocol-mail.txt +++ b/templates/protocol-mail.txt @@ -10,7 +10,7 @@ Zeit: von {{protocol.start_time|timify}} bis {{protocol.end_time|timify}} {% endif %} {% endfor %} -Die Tagesordnung ist: +Die Tagesordnung war: {% for top in protocol.get_tops() %} * {{top.name}} {% endfor %} @@ -23,3 +23,9 @@ Beschlüsse: {% else %} * Keine Beschlüsse {% endif %} + +{% if next_protocol is not none %} +Die nächste Sitzung findet am {{next_protocol.date|datify}} statt. +{% else %} +Es wurde noch keine nächste Sitzung angelegt! +{% endif %}