email

package
v0.0.0-...-60192f8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package email provides functions to send emails.

Index

Constants

This section is empty.

Variables

View Source
var Sender sender

Sender is the default email sender. It's made public so it can be overridden during tests.

Functions

func CanSendEmail

func CanSendEmail() bool

CanSendEmail returns true when we can send emails.

func InitSender

func InitSender()

InitSender initializes the default email sender base on the configuration.

func SendEmail

func SendEmail(
	from string, to string, subject string,
	tpl string, context map[string]interface{},
) error

SendEmail sends a message to the given email address using a template (go template from assets/templates/emails).

Types

type SMTPSender

type SMTPSender struct{}

SMTPSender implements EmailSender for SMTP.

func (*SMTPSender) SendEmail

func (s *SMTPSender) SendEmail(m *mail.Email) error

SendEmail sends an email using SMTP.

type StdOutSender

type StdOutSender struct{}

StdOutSender implements EmailSender for stdout.

func (*StdOutSender) SendEmail

func (s *StdOutSender) SendEmail(m *mail.Email) error

SendEmail "sends" an email to stdout.

Jump to

Keyboard shortcuts

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