email/payload.go

59 lines
1.5 KiB
Go
Raw Normal View History

2022-11-16 07:13:56 +00:00
package email
2022-11-16 07:04:03 +00:00
import (
"git.selly.red/Selly-Modules/natsio"
)
// Config ...
type Config struct {
Nats natsio.Config
}
2022-11-17 06:52:59 +00:00
type To struct {
Name string `json:"name" bson:"name"`
Address string `json:"address" bson:"address"`
}
type From struct {
Name string `json:"name" bson:"name"`
Address string `json:"address" bson:"address"`
}
2022-11-16 07:04:03 +00:00
type Recipient struct {
2022-11-17 06:52:59 +00:00
To []To `json:"to" bson:"to"`
From From `json:"from" bson:"from"`
CC []string `json:"cc,omitempty" bson:"CC,omitempty"`
BCC []string `json:"bcc,omitempty" bson:"BCC,omitempty"`
Subject string `json:"subject,omitempty" bson:"subject,omitempty"`
Attachment []Attachment `json:"attachment,omitempty" bson:"attachment,omitempty"`
2022-11-16 07:04:03 +00:00
}
type Attachment struct {
URL string `json:"url"`
}
type Data struct {
2022-11-17 06:52:59 +00:00
Account string `json:"account" bson:"account,omitempty"`
Password string `json:"password" bson:"password,omitempty"`
2022-11-16 07:04:03 +00:00
}
// SendPayload ...
type SendPayload struct {
2022-11-17 06:52:59 +00:00
Recipient *Recipient `json:"recipient,omitempty" bson:"recipient,omitempty"`
Subject string `json:"subject" bson:"subject"`
Data *Data `json:"data,omitempty" bson:"data,omitempty"`
Key string `json:"key" bson:"key"`
TemplateID string `json:"templateId" bson:"templateId"`
Content *Content `json:"content,omitempty" bson:"content,omitempty"`
}
type Content struct {
Type string `json:"type" bson:"type"`
Value string `json:"value" bson:"value"`
2022-11-16 07:04:03 +00:00
}
// Response ...
type Response struct {
RequestID string `json:"requestId"`
}