40 lines
716 B
Go
40 lines
716 B
Go
package email
|
|
|
|
import "context"
|
|
|
|
type Email interface {
|
|
Send(ctx context.Context, params Request) (*Response, error)
|
|
}
|
|
|
|
type Response struct {
|
|
ID string `json:"id"`
|
|
Status string `json:"status"`
|
|
}
|
|
|
|
type Request struct {
|
|
Html string
|
|
RecipientAddress string
|
|
UserFullName string
|
|
Subject string
|
|
From string
|
|
To string
|
|
Template TemplateData
|
|
}
|
|
|
|
type Template string
|
|
|
|
const (
|
|
TemplateWelcome = "welcome"
|
|
TemplatePasswordReset = "password_reset"
|
|
TemplateEmailVerification = "email_verification"
|
|
)
|
|
|
|
func (e Template) String() string {
|
|
return string(e)
|
|
}
|
|
|
|
type TemplateData struct {
|
|
EmailTemplateName Template
|
|
Data any
|
|
}
|