39 lines
950 B
Go
39 lines
950 B
Go
|
package email
|
||
|
|
||
|
import (
|
||
|
"git.selly.red/Selly-Modules/natsio"
|
||
|
)
|
||
|
|
||
|
// Config ...
|
||
|
type Config struct {
|
||
|
Nats natsio.Config
|
||
|
}
|
||
|
|
||
|
type Recipient struct {
|
||
|
To []string `json:"to,omitempty"`
|
||
|
From string `json:"from,omitempty"`
|
||
|
CC []string `json:"cc,omitempty"`
|
||
|
BCC []string `json:"bcc,omitempty"`
|
||
|
Subject string `json:"subject,omitempty"`
|
||
|
Headers map[string]string `json:"headers,omitempty"`
|
||
|
Substitutions map[string]string `json:"substitutions,omitempty"`
|
||
|
SendAt int `json:"send_at,omitempty"`
|
||
|
Attachment Attachment `json:"attachment"`
|
||
|
}
|
||
|
|
||
|
type Attachment struct {
|
||
|
URL string `json:"url"`
|
||
|
}
|
||
|
|
||
|
// Send ...
|
||
|
type Send struct {
|
||
|
Subject string `json:"subject"`
|
||
|
Recipient Recipient `json:"recipient"`
|
||
|
Data []byte `json:"data"`
|
||
|
}
|
||
|
|
||
|
// Response ...
|
||
|
type Response struct {
|
||
|
RequestID string `json:"requestId"`
|
||
|
}
|