initial commit
This commit is contained in:
39
pkg/email/interface.go
Normal file
39
pkg/email/interface.go
Normal file
@@ -0,0 +1,39 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user