mailutils

package
v0.0.0-...-6b2477e Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package mailutils provides utility functions for sending emails via MailHog or SendGrid.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidMailProvider = errors.New("invalid mail provider, must be 'mailhog' or 'sendgrid'")

ErrInvalidMailProvider is returned when an invalid mail provider is specified.

Functions

This section is empty.

Types

type Mailer

type Mailer interface {
	SendMail(ctx context.Context, to, subject, body string) error
}

Mailer defines an interface for sending emails.

func NewMailer

func NewMailer(cfg *config.MailConfig) (Mailer, error)

NewMailer returns a Mailer instance based on the configured provider. Provider "sendgrid" uses SendGrid API, provider "mailhog" uses SMTP (MailHog for local).

Jump to

Keyboard shortcuts

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