You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@answer.apache.org by "Yash-Chauhan22 (via GitHub)" <gi...@apache.org> on 2026/06/29 10:50:49 UTC

[PR] fix: add proper HTML structure to email templates to reduce spam score [answer]

Yash-Chauhan22 opened a new pull request, #1548:
URL: https://github.com/apache/answer/pull/1548

   (no comment)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org


Re: [PR] fix: add proper HTML structure to email templates to reduce spam score [answer]

Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on PR #1548:
URL: https://github.com/apache/answer/pull/1548#issuecomment-4923270492

   Thanks for working on this. The overall direction makes sense to me. Using a complete HTML document structure for HTML emails is a common practice and should help reduce compatibility issues with mail clients and spam filters.
   
     However, I think this PR needs a few adjustments before it can be merged.
   
     1. Please remove unrelated changes from this PR.
   
     The following files/changes are not related to the email spam-score fix and should be excluded:
   
     - .vscode/settings.json
     - GSOC.md
     - docker-compose.yaml
     - unrelated Go doc comment updates in email_service.go
   
     This PR should focus only on the email template / email sending behavior.
   
     2. Please revert the MIME changes in email_service.go.
   
     gomail.NewMessage() already uses UTF-8 by default, and SetBody("text/html", body) already writes the HTML part with Content-Type: text/html; charset=UTF-8.
   
     gomail also automatically writes Mime-Version: 1.0 if it is not already present.
   
     The current change may cause duplicate or malformed headers:
   
     m.SetHeader("MIME-Version", "1.0")
   
     m.SetBody("text/html; charset=UTF-8", body)
   
     In gomail, the auto-check uses the exact header key Mime-Version, while this PR sets MIME-Version, so gomail may still add its own Mime-Version header. Also, gomail appends ; charset=UTF-8 when writing the body part, so passing text/html; charset=UTF-8 to SetBody may result in duplicated charset
     parameters.
   
     So I suggest keeping the original call:
   
     m.SetBody("text/html", body)
   
     3. Please apply the HTML document structure consistently.
   
     Currently only i18n/en_US.yaml is updated. Since email templates are translated based on the user language, other locales will still send partial HTML fragments without DOCTYPE, html, head, meta, and body.
   
     If we keep the HTML document structure inside i18n templates, then the email templates across locales should be updated consistently, or at least all supported email template bodies should use the same HTML document wrapper.
   
     In short, I agree with the main fix, but the PR should be narrowed down to the email template changes, avoid manual MIME header changes, and remove unrelated development-environment/doc changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org