cluade code review changes
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/mail"
|
||||
"slices"
|
||||
)
|
||||
|
||||
// Sender is the interface that wraps the Send method.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package email
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
@@ -19,7 +20,10 @@ func (DumpToTemp) Send(msg *Message) error {
|
||||
}
|
||||
|
||||
dir := os.TempDir()
|
||||
id, _ := uuid.NewV7()
|
||||
id, err := uuid.NewV7()
|
||||
if err != nil {
|
||||
return fmt.Errorf("email: failed to generate UUID: %w", err)
|
||||
}
|
||||
file := filepath.Join(dir, id.String()+".html")
|
||||
|
||||
if err := os.WriteFile(file, []byte(msg.HtmlBody), 0440); err != nil {
|
||||
|
||||
@@ -87,6 +87,6 @@ func (t SMTP) Send(msg *Message) error {
|
||||
return err
|
||||
}
|
||||
|
||||
slog.Info("sent email %s" + msg.Subject)
|
||||
slog.Info("sent email", slog.String("subject", msg.Subject))
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user