Commit 8266217c authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Add reference to the next protocol in mail

/close #162
parent 47ac38cc
......@@ -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
......
......@@ -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 %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment