mirror of
https://github.com/ivabus/pop
synced 2025-06-08 08:00:27 +03:00
fix: attachments?
This commit is contained in:
parent
72450a7fc6
commit
fc5b088c4f
1 changed files with 2 additions and 6 deletions
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),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue