Skip to content

Commit 7f34a1a

Browse files
ImTotemclaude
andcommitted
refactor: extract email HTML template to separate file
Move inline HTML from template.py to verify.html. template.py now reads from file at runtime. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 894e156 commit 7f34a1a

2 files changed

Lines changed: 41 additions & 34 deletions

File tree

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,11 @@
1-
_VERIFY_HTML = """<!DOCTYPE html>
2-
<html lang="ko">
3-
<head><meta charset="UTF-8"></head>
4-
<body style="margin:0;padding:0;background:#f5f5f5;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;">
5-
<table width="100%" cellpadding="0" cellspacing="0" style="padding:48px 20px;">
6-
<tr><td align="center">
7-
<table width="420" cellpadding="0" cellspacing="0" style="background:#ffffff;border-radius:10px;border:1px solid #e5e5e5;">
8-
<tr><td style="padding:36px 36px 0;">
9-
<p style="margin:0 0 28px;font-size:18px;font-weight:700;color:#0a0a0a;letter-spacing:-0.3px;">BCSD</p>
10-
<p style="margin:0 0 6px;font-size:14px;font-weight:600;color:#0a0a0a;">이메일 인증</p>
11-
<p style="margin:0 0 24px;font-size:14px;color:#737373;line-height:1.5;">
12-
아래 인증 코드를 입력해 주세요.
13-
</p>
14-
</td></tr>
15-
<tr><td style="padding:0 36px;">
16-
<div style="background:#f5f5f5;border:1px solid #e5e5e5;border-radius:10px;padding:24px;text-align:center;">
17-
<span style="font-size:28px;font-weight:700;letter-spacing:6px;color:#0a0a0a;">{code}</span>
18-
</div>
19-
</td></tr>
20-
<tr><td style="padding:24px 36px 36px;">
21-
<p style="margin:0;font-size:13px;color:#a3a3a3;line-height:1.6;">
22-
이 코드는 10분 후 만료됩니다.<br>
23-
본인이 요청하지 않았다면 이 메일을 무시해 주세요.
24-
</p>
25-
</td></tr>
26-
<tr><td style="padding:16px 36px;border-top:1px solid #e5e5e5;">
27-
<p style="margin:0;font-size:12px;color:#a3a3a3;">&copy; BCSD</p>
28-
</td></tr>
29-
</table>
30-
</td></tr>
31-
</table>
32-
</body>
33-
</html>"""
1+
from pathlib import Path
2+
3+
_DIR = Path(__file__).parent
4+
5+
6+
def _load(name: str) -> str:
7+
return (_DIR / name).read_text()
348

359

3610
def verify_body(code: str) -> str:
37-
return _VERIFY_HTML.format(code=code)
11+
return _load("verify.html").format(code=code)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html lang="ko">
3+
<head><meta charset="UTF-8"></head>
4+
<body style="margin:0;padding:0;background:#f5f5f5;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;">
5+
<table width="100%" cellpadding="0" cellspacing="0" style="padding:48px 20px;">
6+
<tr><td align="center">
7+
<table width="420" cellpadding="0" cellspacing="0" style="background:#ffffff;border-radius:10px;border:1px solid #e5e5e5;">
8+
<tr><td style="padding:36px 36px 0;">
9+
<p style="margin:0 0 28px;font-size:18px;font-weight:700;color:#0a0a0a;letter-spacing:-0.3px;">BCSD</p>
10+
<p style="margin:0 0 6px;font-size:14px;font-weight:600;color:#0a0a0a;">이메일 인증</p>
11+
<p style="margin:0 0 24px;font-size:14px;color:#737373;line-height:1.5;">
12+
아래 인증 코드를 입력해 주세요.
13+
</p>
14+
</td></tr>
15+
<tr><td style="padding:0 36px;">
16+
<div style="background:#f5f5f5;border:1px solid #e5e5e5;border-radius:10px;padding:24px;text-align:center;">
17+
<span style="font-size:28px;font-weight:700;letter-spacing:6px;color:#0a0a0a;">{code}</span>
18+
</div>
19+
</td></tr>
20+
<tr><td style="padding:24px 36px 36px;">
21+
<p style="margin:0;font-size:13px;color:#a3a3a3;line-height:1.6;">
22+
이 코드는 10분 후 만료됩니다.<br>
23+
본인이 요청하지 않았다면 이 메일을 무시해 주세요.
24+
</p>
25+
</td></tr>
26+
<tr><td style="padding:16px 36px;border-top:1px solid #e5e5e5;">
27+
<p style="margin:0;font-size:12px;color:#a3a3a3;">&copy; BCSD</p>
28+
</td></tr>
29+
</table>
30+
</td></tr>
31+
</table>
32+
</body>
33+
</html>

0 commit comments

Comments
 (0)