fix: attachments?

This commit is contained in:
Maas Lalani 2023-06-15 15:37:47 -04:00
parent 72450a7fc6
commit fc5b088c4f
No known key found for this signature in database
GPG key ID: 5A6ED5CBF1A0A000

View file

@ -47,16 +47,12 @@ func sendEmail(to []string, from, subject, body string, paths []string) error {
attachments := make([]resend.Attachment, len(paths))
for i, a := range paths {
abs, err := filepath.Abs(a)
if err != nil {
continue
}
content, err := os.ReadFile(abs)
f, err := os.ReadFile(a)
if err != nil {
continue
}
attachments[i] = resend.Attachment{
Content: string(content),
Content: string(f),
Filename: filepath.Base(a),
}
}