Documentation ¶
Overview ¶
Package mailer acts a central mail server for the application.
It implements various types of communication with actual mail servers (sendmail, smtp, sendgrid API) and a simple queue mechanism to avoid spamming these servers.
Index ¶
- Constants
- Variables
- func MigrateQueue(mainCtx, fromCtx, toCtx context.Context, dryRun bool, ...) (map[string]int, error)
- func NewGomailMessage(email *mailer.Mail) (*gomail.Message, error)
- func QueueJob(name string) *jobs.Job
- func RegisterQueueJob(ctx context.Context, name string) error
- type NoOpSender
- type Queue
- type SendGrid
- type Sender
- type Sendmail
- type Smtp
Constants ¶
View Source
const (
// MaxSendRetries defines number of retries in case of connection failure.
MaxSendRetries = 5
)
Variables ¶
View Source
var Drivers = service.StorageDrivers{}
Functions ¶
func MigrateQueue ¶
func MigrateQueue(mainCtx, fromCtx, toCtx context.Context, dryRun bool, status chan service.MigratorStatus) (map[string]int, error)
MigrateQueue is a MigratorFunc to move queued emails from one Queue to another.
func NewGomailMessage ¶
NewGomailMessage prepares a new Message to be sent.
Types ¶
type NoOpSender ¶
type NoOpSender struct {
// contains filtered or unexported fields
}
type SendGrid ¶
type SendGrid struct {
ApiKey string
}
SendGrid is a passerelle to Sendgrid API. It holds the application API Key.
type Sender ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
dao
|
|
service
Package service provides the actual logic for posting emails to queue or to mail servers
|
Package service provides the actual logic for posting emails to queue or to mail servers |
Package lang provides i18n strings for mailer-related data.
|
Package lang provides i18n strings for mailer-related data. |
service
Package service exposes a simple API for posting emails
|
Package service exposes a simple API for posting emails |
Package templates defines ready-to-use templates to send email in a nice formatting.
|
Package templates defines ready-to-use templates to send email in a nice formatting. |
Click to show internal directories.
Click to hide internal directories.