email

package
v0.41.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBrevoEnabled added in v0.38.0

func IsBrevoEnabled(db *sql.DB) bool

IsBrevoEnabled checks if Brevo is enabled in settings

func IsSMTPEnabled added in v0.38.0

func IsSMTPEnabled(db *sql.DB) bool

IsSMTPEnabled checks if SMTP is enabled in settings

func SendAdminNotification

func SendAdminNotification(ctx context.Context, adminEmail, userName, userEmail, companyName, lang string) error

SendAdminNotification sends a notification email to an admin

func SendEmailWithFallback added in v0.37.0

func SendEmailWithFallback(ctx context.Context, msg *mail.Msg) error

SendEmailWithFallback attempts to send via Brevo first, then Gmail on failure

func SendVerificationCode

func SendVerificationCode(ctx context.Context, to, code, lang string) error

SendVerificationCode sends a verification code email to the user

Types

type BrevoClient added in v0.37.0

type BrevoClient struct {
	// contains filtered or unexported fields
}

BrevoClient wraps the Brevo API client

func NewBrevoClient added in v0.37.0

func NewBrevoClient(db *sql.DB) (*BrevoClient, error)

NewBrevoClient creates a new Brevo API client from environment or database

func (*BrevoClient) SendContractExpiryViaBrevo added in v0.37.0

func (bc *BrevoClient) SendContractExpiryViaBrevo(
	ctx context.Context,
	contractNumber string,
	daysLeft int,
	expiryDate time.Time,
	contractName string,
	clientName string,
	companyName string,
	contractID int64,
	recipients []string,
	adminEmail string,
) error

SendContractExpiryViaBrevo sends a contract expiry notification via Brevo API

type EmailTemplate added in v0.33.0

type EmailTemplate struct {
	Subject string
	HTML    string
}

EmailTemplate holds localized email content

func GetAdminNotificationTemplate added in v0.33.0

func GetAdminNotificationTemplate(lang, userName, userEmail, companyName string) EmailTemplate

GetAdminNotificationTemplate returns the localized admin notification template

func GetVerificationTemplate added in v0.33.0

func GetVerificationTemplate(lang, code string) EmailTemplate

GetVerificationTemplate returns the localized verification email template

Jump to

Keyboard shortcuts

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