feat(email): improve email templating (#27)

This commit is contained in:
oidq
2024-09-16 23:10:08 +02:00
committed by GitHub
parent 1f0ec08290
commit 64cf56276a
14 changed files with 711 additions and 167 deletions

View File

@@ -2,6 +2,7 @@ package bootstrap
import (
"log"
"os"
"time"
"github.com/gin-gonic/gin"
@@ -28,7 +29,12 @@ func initRouter(db *gorm.DB, appConfigService *service.AppConfigService) {
r.Use(gin.Logger())
// Initialize services
emailService := service.NewEmailService(appConfigService)
templateDir := os.DirFS(common.EnvConfig.EmailTemplatesPath)
emailService, err := service.NewEmailService(appConfigService, templateDir)
if err != nil {
log.Fatalf("Unable to create email service: %s", err)
}
auditLogService := service.NewAuditLogService(db, appConfigService, emailService)
jwtService := service.NewJwtService(appConfigService)
webauthnService := service.NewWebAuthnService(db, jwtService, auditLogService, appConfigService)