fix: connect EmailService to contact form handler

The contact form was logging submissions but never actually sending emails.
This commit:
- Adds EmailService field to CVHandler
- Initializes EmailService in main.go with SMTP config
- Calls SendContactForm in HandleContact handler
- Updates all test files to pass nil for emailService parameter
This commit is contained in:
juanatsap
2025-12-02 14:27:03 +00:00
parent 9842f183ea
commit f3842a3486
9 changed files with 66 additions and 30 deletions
+6 -6
View File
@@ -21,7 +21,7 @@ func BenchmarkHome(b *testing.B) {
b.Fatalf("Failed to create template manager: %v", err)
}
handler := NewCVHandler(tmplManager, "localhost:8080")
handler := NewCVHandler(tmplManager, "localhost:8080", nil)
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -43,7 +43,7 @@ func BenchmarkCVContent(b *testing.B) {
b.Fatalf("Failed to create template manager: %v", err)
}
handler := NewCVHandler(tmplManager, "localhost:8080")
handler := NewCVHandler(tmplManager, "localhost:8080", nil)
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -65,7 +65,7 @@ func BenchmarkToggleLength(b *testing.B) {
b.Fatalf("Failed to create template manager: %v", err)
}
handler := NewCVHandler(tmplManager, "localhost:8080")
handler := NewCVHandler(tmplManager, "localhost:8080", nil)
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -101,7 +101,7 @@ func BenchmarkPrepareTemplateData(b *testing.B) {
b.Fatalf("Failed to create template manager: %v", err)
}
handler := NewCVHandler(tmplManager, "localhost:8080")
handler := NewCVHandler(tmplManager, "localhost:8080", nil)
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -144,7 +144,7 @@ func BenchmarkParallelHome(b *testing.B) {
b.Fatalf("Failed to create template manager: %v", err)
}
handler := NewCVHandler(tmplManager, "localhost:8080")
handler := NewCVHandler(tmplManager, "localhost:8080", nil)
b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {
@@ -168,7 +168,7 @@ func BenchmarkParallelToggleLength(b *testing.B) {
b.Fatalf("Failed to create template manager: %v", err)
}
handler := NewCVHandler(tmplManager, "localhost:8080")
handler := NewCVHandler(tmplManager, "localhost:8080", nil)
b.ResetTimer()
b.RunParallel(func(pb *testing.PB) {