[PR #27] [MERGED] Improve email templating #968

Closed
opened 2025-10-08 00:20:39 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/pocket-id/pocket-id/pull/27
Author: @oidq
Created: 9/13/2024
Status: Merged
Merged: 9/17/2024
Merged by: @stonith404

Base: mainHead: templating


📝 Commits (4)

  • dcca6b2 feat: use html/template and text/template for templating
  • 193d036 feat: support UTF-8 headers
  • c4b8ad6 fix: fix tests and move templates to fs.FS
  • 9b23e2f fix: remove nested container & clear leftovers

📊 Changes

14 files changed (+711 additions, -167 deletions)

View changed files

backend/email-templates/components/email_html.tmpl (+14 -0)
backend/email-templates/components/email_text.tmpl (+7 -0)
backend/email-templates/components/style_html.tmpl (+80 -0)
backend/email-templates/login-with-new-device.html (+0 -119)
backend/email-templates/login-with-new-device_html.tmpl (+30 -0)
backend/email-templates/login-with-new-device_text.tmpl (+12 -0)
📝 backend/internal/bootstrap/router_bootstrap.go (+7 -1)
📝 backend/internal/common/env_config.go (+14 -12)
📝 backend/internal/service/audit_log_service.go (+9 -6)
📝 backend/internal/service/email_service.go (+99 -29)
backend/internal/service/email_service_templates.go (+37 -0)
backend/internal/utils/email/composer.go (+213 -0)
backend/internal/utils/email/composer_test.go (+92 -0)
backend/internal/utils/email/email_service_templates.go (+97 -0)

📄 Description

  • send email in multipart/alternative form with text and html versions
  • support UTF-8 headers and address headers
  • add names to email addresses in emails
  • use text/template and html/template for templating with shared components folder
  • tests for new utils/email

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/pocket-id/pocket-id/pull/27 **Author:** [@oidq](https://github.com/oidq) **Created:** 9/13/2024 **Status:** ✅ Merged **Merged:** 9/17/2024 **Merged by:** [@stonith404](https://github.com/stonith404) **Base:** `main` ← **Head:** `templating` --- ### 📝 Commits (4) - [`dcca6b2`](https://github.com/pocket-id/pocket-id/commit/dcca6b232816bbc3bbd0d1a20e3fcba95b44cabf) feat: use html/template and text/template for templating - [`193d036`](https://github.com/pocket-id/pocket-id/commit/193d0360f784a1fdee92877766ab4436d719f33d) feat: support UTF-8 headers - [`c4b8ad6`](https://github.com/pocket-id/pocket-id/commit/c4b8ad6556d7a56fe1de06d8054902efa88a4833) fix: fix tests and move templates to fs.FS - [`9b23e2f`](https://github.com/pocket-id/pocket-id/commit/9b23e2f1d4fc21763eee1d3977edfd9d618aa663) fix: remove nested container & clear leftovers ### 📊 Changes **14 files changed** (+711 additions, -167 deletions) <details> <summary>View changed files</summary> ➕ `backend/email-templates/components/email_html.tmpl` (+14 -0) ➕ `backend/email-templates/components/email_text.tmpl` (+7 -0) ➕ `backend/email-templates/components/style_html.tmpl` (+80 -0) ➖ `backend/email-templates/login-with-new-device.html` (+0 -119) ➕ `backend/email-templates/login-with-new-device_html.tmpl` (+30 -0) ➕ `backend/email-templates/login-with-new-device_text.tmpl` (+12 -0) 📝 `backend/internal/bootstrap/router_bootstrap.go` (+7 -1) 📝 `backend/internal/common/env_config.go` (+14 -12) 📝 `backend/internal/service/audit_log_service.go` (+9 -6) 📝 `backend/internal/service/email_service.go` (+99 -29) ➕ `backend/internal/service/email_service_templates.go` (+37 -0) ➕ `backend/internal/utils/email/composer.go` (+213 -0) ➕ `backend/internal/utils/email/composer_test.go` (+92 -0) ➕ `backend/internal/utils/email/email_service_templates.go` (+97 -0) </details> ### 📄 Description * send email in multipart/alternative form with text and html versions * support UTF-8 headers and address headers * add names to email addresses in emails * use text/template and html/template for templating with shared components folder * tests for new utils/email --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2025-10-08 00:20:39 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pocket-id-pocket-id-1#968