feat: add HTML email body for --send (#48)
Add email.html config flag (default false). When enabled, --send includes an HTML version of the report body generated via HTMLFormatter alongside the plain-text part in a multipart/alternative message. - EmailConfig gains html: bool field - mailer.build_message/send_report accept rows for HTML generation - CLI passes rows to send_report - --init-config generates email.html: false - README.md and docs/CONFIG.md updated Bump version to 1.10.0. Closes #48
This commit is contained in:
@@ -76,6 +76,7 @@ def _run_init_config(config_path: str, force: bool) -> int:
|
||||
"no_time": False,
|
||||
},
|
||||
"email": {
|
||||
"html": False,
|
||||
"smtp": {
|
||||
"host": "",
|
||||
"port": 587,
|
||||
@@ -209,7 +210,13 @@ def _save_and_maybe_send(
|
||||
return 1
|
||||
|
||||
try:
|
||||
send_report(email_config, output_arg, author, f"{from_date}--{to_date}")
|
||||
send_report(
|
||||
email_config,
|
||||
output_arg,
|
||||
author,
|
||||
f"{from_date}--{to_date}",
|
||||
rows=rows,
|
||||
)
|
||||
print(f"📧 Report sent to {', '.join(email_config.to)}")
|
||||
except RedmineAPIError as e:
|
||||
print(f"❌ {e.message}", file=sys.stderr)
|
||||
|
||||
Reference in New Issue
Block a user