mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-28 12:11:58 +08:00

* feat(emailing): initial commit for emailing * feat(emailing): implement emailing * test(integration): fix tests * fix(emailing): fix directory path * fix(emailing): fix email template path * fix(emailing): copy from go-gomail * fix(emailing): copy from go-gomail * fix(emailing): fix smtp bugs * test(integration): fix tests * feat(emailing): let missing templates passthrough * feat(emailing): let missing templates passthrough * feat(smtp): refactor and beautify * test(integration): fix tests * docs(smtp): fix incorrect grammer * feat(smtp): add to header * feat(smtp): remove comments * chore(smtp): address comments --------- Co-authored-by: Vikrant Gupta <vikrant@signoz.io>
57 lines
813 B
Go
57 lines
813 B
Go
package client
|
|
|
|
type Auth struct {
|
|
Username string
|
|
Password string
|
|
Identity string
|
|
Secret string
|
|
}
|
|
|
|
type TLS struct {
|
|
Enabled bool
|
|
InsecureSkipVerify bool
|
|
CAFilePath string
|
|
KeyFilePath string
|
|
CertFilePath string
|
|
}
|
|
|
|
type options struct {
|
|
from string
|
|
headers map[string]string
|
|
hello string
|
|
auth Auth
|
|
tls TLS
|
|
}
|
|
|
|
type Option func(*options)
|
|
|
|
func WithFrom(s string) Option {
|
|
return func(o *options) {
|
|
o.from = s
|
|
}
|
|
}
|
|
|
|
func WithHeaders(m map[string]string) Option {
|
|
return func(o *options) {
|
|
o.headers = m
|
|
}
|
|
}
|
|
|
|
func WithHello(s string) Option {
|
|
return func(o *options) {
|
|
o.hello = s
|
|
}
|
|
}
|
|
|
|
func WithAuth(auth Auth) Option {
|
|
return func(o *options) {
|
|
o.auth = auth
|
|
}
|
|
}
|
|
|
|
func WithTLS(tls TLS) Option {
|
|
return func(o *options) {
|
|
o.tls = tls
|
|
}
|
|
}
|