0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-22 10:05:11 +01:00
gitea/services/mailer/sender/dummy.go
Lunny Xiao 79d593a9be
Split mail sender sub package from mailer service package (#32618)
Move all mail sender related codes into a sub package of
services/mailer. Just move, no code change.
Then we just have dependencies on go-mail package in the new sub
package. We can use other package to replace it because it's
unmaintainable. ref #18664
2024-11-30 01:15:41 +00:00

27 lines
535 B
Go

// Copyright 2024 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package sender
import (
"bytes"
"io"
"code.gitea.io/gitea/modules/log"
)
// DummySender Sender sendmail mail sender
type DummySender struct{}
var _ Sender = &DummySender{}
// Send send email
func (s *DummySender) Send(from string, to []string, msg io.WriterTo) error {
buf := bytes.Buffer{}
if _, err := msg.WriteTo(&buf); err != nil {
return err
}
log.Debug("Mail From: %s To: %v Body: %s", from, to, buf.String())
return nil
}