fix: attachments?
This commit is contained in:
8
email.go
8
email.go
@@ -47,16 +47,12 @@ func sendEmail(to []string, from, subject, body string, paths []string) error {
|
|||||||
|
|
||||||
attachments := make([]resend.Attachment, len(paths))
|
attachments := make([]resend.Attachment, len(paths))
|
||||||
for i, a := range paths {
|
for i, a := range paths {
|
||||||
abs, err := filepath.Abs(a)
|
f, err := os.ReadFile(a)
|
||||||
if err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
content, err := os.ReadFile(abs)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
attachments[i] = resend.Attachment{
|
attachments[i] = resend.Attachment{
|
||||||
Content: string(content),
|
Content: string(f),
|
||||||
Filename: filepath.Base(a),
|
Filename: filepath.Base(a),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user