Documentation
¶
Index ¶
- func IsBrevoEnabled(db *sql.DB) bool
- func IsSMTPEnabled(db *sql.DB) bool
- func SendAdminNotification(ctx context.Context, adminEmail, userName, userEmail, companyName, lang string) error
- func SendEmailWithFallback(ctx context.Context, msg *mail.Msg) error
- func SendVerificationCode(ctx context.Context, to, code, lang string) error
- type BrevoClient
- type EmailTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBrevoEnabled ¶ added in v0.38.0
IsBrevoEnabled checks if Brevo is enabled in settings
func IsSMTPEnabled ¶ added in v0.38.0
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
SendEmailWithFallback attempts to send via Brevo first, then Gmail on failure
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
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
Click to show internal directories.
Click to hide internal directories.