email

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2025 License: MIT Imports: 4 Imported by: 0

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

func QrEmbed(content string) string

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 SenderName

func SenderName(name string)

SenderName sets the sender's name.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL