2022-07-07 05:19:05 +08:00
|
|
|
package mailer
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
"net/mail"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Mailer defines a base mail client interface.
|
|
|
|
type Mailer interface {
|
|
|
|
// Send sends an email with HTML body to the specified recipient.
|
|
|
|
Send(
|
|
|
|
fromEmail mail.Address,
|
|
|
|
toEmail mail.Address,
|
|
|
|
subject string,
|
2022-08-21 19:30:36 +08:00
|
|
|
htmlContent string,
|
2022-07-07 05:19:05 +08:00
|
|
|
attachments map[string]io.Reader,
|
|
|
|
) error
|
|
|
|
}
|