Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AliyunConfig ¶
AliyunConfig holds the configuration for Aliyun DirectMail
type AliyunSender ¶
type AliyunSender struct {
Config *AliyunConfig
}
AliyunSender implements EmailSender for Aliyun
func (*AliyunSender) SendTemplateEmail ¶
func (s *AliyunSender) SendTemplateEmail(recipientEmail string, template Template) (string, error)
type Email ¶
type Email struct {
Provider string `json:"provider" yaml:"provider"`
Mailgun *MailgunConfig `json:"mailgun" yaml:"mailgun"`
Aliyun *AliyunConfig `json:"aliyun" yaml:"aliyun"`
NetEase *NetEaseConfig `json:"netease" yaml:"netease"`
SendGrid *SendGridConfig `json:"sendgrid" yaml:"sendgrid"`
SMTP *SMTPConfig `json:"smtp" yaml:"smtp"`
TencentCloud *TencentCloudConfig `json:"tencent_cloud" yaml:"tencent_cloud"`
}
Email holds the configuration for all email providers
type LocalSMTPSender ¶
type LocalSMTPSender struct {
Config *SMTPConfig
}
LocalSMTPSender implements EmailSender for local SMTP
func (*LocalSMTPSender) SendTemplateEmail ¶
func (s *LocalSMTPSender) SendTemplateEmail(recipientEmail string, template Template) (string, error)
type MailgunConfig ¶
MailgunConfig holds the configuration for Mailgun
type MailgunSender ¶
type MailgunSender struct {
Config *MailgunConfig
}
MailgunSender implements EmailSender for Mailgun
func (*MailgunSender) SendTemplateEmail ¶
func (s *MailgunSender) SendTemplateEmail(recipientEmail string, template Template) (string, error)
type NetEaseConfig ¶
type NetEaseConfig struct {
Username string
Password string
From string
SMTPHost string
SMTPPort string
}
NetEaseConfig holds the configuration for NetEase Enterprise Email
type NetEaseSender ¶
type NetEaseSender struct {
Config *NetEaseConfig
}
NetEaseSender implements EmailSender for NetEase
func (*NetEaseSender) SendTemplateEmail ¶
func (s *NetEaseSender) SendTemplateEmail(recipientEmail string, template Template) (string, error)
type SMTPConfig ¶
type SMTPConfig struct {
SMTPHost string
SMTPPort string
Username string
Password string
From string
}
SMTPConfig holds the configuration for local email sending
type SendGridConfig ¶
SendGridConfig holds the configuration for SendGrid
type SendGridSender ¶
type SendGridSender struct {
Config *SendGridConfig
}
SendGridSender implements EmailSender for SendGrid
func (*SendGridSender) SendTemplateEmail ¶
func (s *SendGridSender) SendTemplateEmail(recipientEmail string, template Template) (string, error)
type Sender ¶
type Sender interface {
SendTemplateEmail(recipientEmail string, template Template) (string, error)
}
Sender is a generic interface for sending emails
type Template ¶
type Template struct {
Subject string `json:"subject"`
Template string `json:"template"`
Keyword string `json:"keyword"`
URL string `json:"url"`
Data any `json:"data"`
}
Template represents the email template
type TencentCloudConfig ¶
TencentCloudConfig holds the configuration for Tencent Cloud Simple Email Service
type TencentCloudSender ¶
type TencentCloudSender struct {
Config *TencentCloudConfig
}
TencentCloudSender implements EmailSender for Tencent Cloud
func (*TencentCloudSender) SendTemplateEmail ¶
func (s *TencentCloudSender) SendTemplateEmail(recipientEmail string, template Template) (string, error)