mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 23:01:09 +02:00
fix(mana-notify): add Message-ID and Date headers to outgoing emails
Gmail rejects emails without a valid Message-ID header (RFC 5322). Add Message-ID and Date headers to all outgoing emails. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
3b4dfb1bdf
commit
7797930ed4
1 changed files with 4 additions and 0 deletions
|
|
@ -89,10 +89,14 @@ func (s *EmailService) Send(msg *EmailMessage) EmailResult {
|
|||
}
|
||||
|
||||
// Build email headers and body
|
||||
msgID := fmt.Sprintf("<%d.%s@mana.how>", time.Now().UnixNano(), msg.To)
|
||||
|
||||
var builder strings.Builder
|
||||
builder.WriteString(fmt.Sprintf("From: %s\r\n", from))
|
||||
builder.WriteString(fmt.Sprintf("To: %s\r\n", msg.To))
|
||||
builder.WriteString(fmt.Sprintf("Subject: %s\r\n", msg.Subject))
|
||||
builder.WriteString(fmt.Sprintf("Message-ID: %s\r\n", msgID))
|
||||
builder.WriteString(fmt.Sprintf("Date: %s\r\n", time.Now().UTC().Format(time.RFC1123Z)))
|
||||
if msg.ReplyTo != "" {
|
||||
builder.WriteString(fmt.Sprintf("Reply-To: %s\r\n", msg.ReplyTo))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue