Subject abhängig von Status der Rechnung

This commit is contained in:
Fritz Grimpen 2024-10-04 12:06:23 +00:00
parent 039cb97d0c
commit 95a856ef73

View file

@ -98,7 +98,7 @@ def fee_invoice(env: Env):
msg["From"] = env.args.email_from msg["From"] = env.args.email_from
msg["To"] = email_address msg["To"] = email_address
msg["Date"] = env.args.email_date or datetime.datetime.now() msg["Date"] = env.args.email_date or datetime.datetime.now()
msg["Subject"] = f"Beitragsrechnung {year.year} ({invoice.number})" msg["Subject"] = f"Beitragsrechnung {year.year} ({invoice.number})" if invoice.number else f"Vorläufige Beitragsrechnung {year.year}"
msg["Message-Id"] = member['message_id'] msg["Message-Id"] = member['message_id']
msg.set_content(template.render(**template_args)) msg.set_content(template.render(**template_args))
with (env.args.output_dir / member['message_id']).open("wb") as mailfile: with (env.args.output_dir / member['message_id']).open("wb") as mailfile: