threads
This commit is contained in:
@@ -73,7 +73,19 @@ func (s *session) Data(r io.Reader) error {
|
||||
files := make([]*utils.File, 0, len(attachments)+len(inlines))
|
||||
files = append(files, attachments...)
|
||||
files = append(files, inlines...)
|
||||
return s.client.Send(s.ctx, s.from, s.to, eml.GetHeader("Subject"), eml.Text, eml.HTML, files)
|
||||
|
||||
email := &utils.Email{
|
||||
MessageID: eml.GetHeader("Message-Id"),
|
||||
InReplyTo: eml.GetHeader("In-Reply-To"),
|
||||
Subject: eml.GetHeader("Subject"),
|
||||
From: s.from,
|
||||
To: s.to,
|
||||
Text: eml.Text,
|
||||
HTML: eml.HTML,
|
||||
Files: files,
|
||||
}
|
||||
|
||||
return s.client.Send(s.ctx, email)
|
||||
}
|
||||
|
||||
func (s *session) Reset() {}
|
||||
|
||||
@@ -11,5 +11,5 @@ import (
|
||||
// Client interface to send emails
|
||||
type Client interface {
|
||||
GetMapping(context.Context, string) (id.RoomID, bool)
|
||||
Send(ctx context.Context, from, mailbox, subject, text, html string, files []*utils.File) error
|
||||
Send(ctx context.Context, email *utils.Email) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user