"""D04 예정노선 확정 메일 — 업체에 그 연도 노선 묶음(zip)을 첨부해 보낸다 (요구 349-9).""" from __future__ import annotations import html from common_util.common_util_email import Attachment, send_email def build_completion_mail( *, project_name: str, region: str | None, year: int, length_m: float, recipient: str, attachment_names: list[str], ) -> tuple[str, str]: """(제목, HTML 본문) — 프로젝트명 · 연도 · 연장 · 첨부 목록.""" esc = html.escape rows = [ ("프로젝트", project_name), ("사업 지역", region or "-"), ("연도", f"{year}년"), ("연장", f"{length_m / 1000:,.3f} km ({length_m:,.1f} m)"), ] table = "".join( f"
안녕하세요, {esc(recipient)} 담당자님.
예정노선이 확정되어 {year}년 노선 파일을 보내 드립니다.
첨부 파일
압축을 풀면 shapefile(.shp · .shx · .dbf · .prj · .cpg · 좌표계 UTM-K)이 들어 있으며, 임도 설계 프로그램의 노선 입력에 그대로 올릴 수 있습니다.
""" return f"[예정노선 확정] {project_name} {year}년", body async def send_completion_mail( *, to_email: str, subject: str, body: str, attachments: list[Attachment] ) -> bool: return await send_email(to_email=to_email, subject=subject, html=body, attachments=attachments)