260706_1_계정, 로그인, 보안 초안 작성
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
"""Aislo 인증·조직 알림 이메일 템플릿."""
|
||||
|
||||
from html import escape
|
||||
|
||||
|
||||
def otp_email(code: str, purpose: str) -> tuple[str, str]:
|
||||
safe_code = escape(code)
|
||||
safe_purpose = escape(purpose)
|
||||
subject = f"[Aislo] {purpose} 인증 코드"
|
||||
html = (
|
||||
"<h2>Aislo 이메일 인증</h2>"
|
||||
f"<p>{safe_purpose} 인증 코드는 다음과 같습니다.</p>"
|
||||
f"<p style='font-size:28px;font-weight:700;letter-spacing:6px'>{safe_code}</p>"
|
||||
"<p>코드는 5분 동안 유효합니다.</p>"
|
||||
)
|
||||
return subject, html
|
||||
|
||||
|
||||
def join_request_email(member_name: str, member_email: str) -> tuple[str, str]:
|
||||
subject = "[Aislo] 신규 팀원 가입 승인 요청"
|
||||
html = (
|
||||
"<h2>팀원 가입 승인 요청</h2>"
|
||||
f"<p>{escape(member_name)} ({escape(member_email)}) 님이 회사 가입을 요청했습니다.</p>"
|
||||
"<p>Aislo 마스터 화면에서 승인 또는 거부해 주세요.</p>"
|
||||
)
|
||||
return subject, html
|
||||
|
||||
|
||||
def join_result_email(approved: bool) -> tuple[str, str]:
|
||||
result = "승인" if approved else "거부"
|
||||
return f"[Aislo] 가입 요청 {result}", f"<p>회사 가입 요청이 {result}되었습니다.</p>"
|
||||
|
||||
|
||||
def security_alert_email(email: str, failures: int) -> tuple[str, str]:
|
||||
return (
|
||||
"[Aislo] 반복 로그인 실패 경고",
|
||||
f"<p>{escape(email)} 계정에서 로그인 실패가 {failures}회 발생했습니다.</p>",
|
||||
)
|
||||
|
||||
|
||||
def support_request_email(
|
||||
name: str,
|
||||
email: str,
|
||||
phone: str | None,
|
||||
company_name: str | None,
|
||||
subject: str,
|
||||
message: str,
|
||||
) -> tuple[str, str]:
|
||||
# 제목: 회사명이 있으면 [회사명 · 이름], 없으면 [이름]
|
||||
who = f"{company_name} · {name}" if company_name else name
|
||||
subject_text = f"[Aislo 문의|{escape(who)}] {escape(subject)}"
|
||||
|
||||
# 줄바꿈을 <br>로 변환하여 본문 가독성 유지
|
||||
safe_message = escape(message).replace("\n", "<br>")
|
||||
company_row = f"<p><strong>회사:</strong> {escape(company_name)}</p>" if company_name else ""
|
||||
phone_row = f"<p><strong>연락처:</strong> {escape(phone)}</p>" if phone else ""
|
||||
html = (
|
||||
"<h2>새 기술지원 문의가 접수되었습니다</h2>"
|
||||
f"{company_row}"
|
||||
f"<p><strong>이름:</strong> {escape(name)}</p>"
|
||||
f"<p><strong>이메일:</strong> {escape(email)}</p>"
|
||||
f"{phone_row}"
|
||||
f"<p><strong>제목:</strong> {escape(subject)}</p>"
|
||||
"<hr>"
|
||||
f"<p><strong>문의 내용:</strong></p><p>{safe_message}</p>"
|
||||
"<hr>"
|
||||
f"<p>답변은 위 이메일 주소(<a href='mailto:{escape(email)}'>"
|
||||
f"{escape(email)}</a>)로 회신하세요.</p>"
|
||||
)
|
||||
return subject_text, html
|
||||
Reference in New Issue
Block a user