Documentation
¶
Overview ¶
Package email provides functionality to send HTML emails with embedded QR codes. It includes methods to set sender credentials, create email content, and send emails using the built-in gomail package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Mail ¶
func Mail(Mail MailData)
Mail sends an HTML email with an embedded QR code image. It uses the gomail package to create and send the email.
func QrEmbed ¶
QrEmbed returns the content ID for embedding QR codes in emails. This is a placeholder function that can be customized as needed. It is used to generate a content ID for the QR code image in the email.
func SenderEmail ¶
func SenderEmail(email string)
SenderEmail sets the sender's email address. This should be used with caution and not hard-coded in production code. Consider using environment variables or secure vaults for sensitive information.
func SenderPassword ¶
func SenderPassword(pw string)
SenderPassword sets the sender's email password. This should be used with caution and not hard-coded in production code. Consider using environment variables or secure vaults for sensitive information.
Types ¶
type MailData ¶
type MailData struct {
ToEmail string // Recipient's email address
Subject string // Subject of the email
Body string // HTML body of the email
Qrcode string // File path of the QR code image
Cid string // Content ID for the embedded image
}
MailData holds the data required to send an email. It includes the recipient's email, subject, body, QR code file path, and content ID for embedding images.