Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientOptions ¶
type ClientOptions struct {
Type string
Host string
Port int
Username string
Password string //#nosec
TLSConfig *tls.Config
// contains filtered or unexported fields
}
ClientOptions holds the configuration for the email client
type EmailClient ¶
func NewGomailClient ¶
func NewGomailClient(opts ...Option) (EmailClient, error)
NewGomailClient creates a new gomail client @param opts: The options for the gomail client @return: The gomail client @return: The error if any must provide logger
func NewSESClient ¶
func NewSESClient(awsManager *aws.AWSManager, opts ...Option) (EmailClient, error)
NewSESClient creates a new SES email client using an existing AWSManager
type EmailData ¶
type EmailData struct {
FromName string
From string
To []string
CC []string
BCC []string
Subject string
TextBody string
HTMLBody string
Attachments []string // supports local paths or URLs
TemplateData map[string]string
// Custom headers if needed
Headers map[string]string
}
EmailData represents the data for an email message This is the data that is passed to the email client to send an email @field From: The sender's email address <No Reply <email>> @field To: The recipient's email address <email> @field CC: The carbon copy recipients' email addresses <email> @field BCC: The blind carbon copy recipients' email addresses <email> @field Subject: The subject of the email <string> @field TextBody: The body of the email in plain text <string> @field HTMLBody: The body of the email in HTML <string> @field Attachments: The attachments to be sent with the email <string> @field TemplateData: The data to be used for templating <map[string]string> @field Headers: The custom headers to be added to the email <map[string]string>
func NewEmailData ¶
func NewEmailData() *EmailData
type GomailClient ¶
type GomailClient struct {
// contains filtered or unexported fields
}
func (*GomailClient) Send ¶
func (c *GomailClient) Send(data *EmailData) error
type MailServerConfig ¶
MailServerConfig holds the complete configuration for both SMTP (sending) and IMAP (receiving) services for an email provider.
func GetServer ¶
func GetServer(provider string) (MailServerConfig, error)
GetServer gets the complete mail server config for a provider (SMTP and IMAP). The function name GetServer is maintained for backward compatibility with the original intent.
type Option ¶
type Option func(*ClientOptions)
func WithClientType ¶
WithClientType sets the client type for the email client @param clientType: The client type for the email client
func WithCredentials ¶
WithCredentials sets the username and password for the email client @param username: The username or email for the email client @param password: The password for the email client
func WithTLSConfig ¶
WithTLSConfig sets the TLS configuration for the email client @param config: The TLS configuration for the email client