Documentation ¶
Overview ¶
Package mail provides functionality for sending emails required for signup and resetting of passwords.
Index ¶
- type Controller
- func (controller *Controller) CreateMessageBuffer(from string, to string, subject string, message string, plainMessage string) bytes.Buffer
- func (controller *Controller) SendEmail(email string, subject string, message string, plainMessage string) error
- func (controller *Controller) SendEmailVerification(username string, email string, verification string) error
- func (controller *Controller) SendPasswordReset(username string, email string, verification string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller handles sending mails via a given SMTP server as required by the app
func SetupMailController ¶
func SetupMailController(conf *misc.Configuration, db database.Connection) *Controller
SetupMailController initialises a new mail controller
func (*Controller) CreateMessageBuffer ¶
func (controller *Controller) CreateMessageBuffer(from string, to string, subject string, message string, plainMessage string) bytes.Buffer
CreateMessageBuffer creates a byte-buffer containing the properly formatted mail message content
func (*Controller) SendEmail ¶
func (controller *Controller) SendEmail(email string, subject string, message string, plainMessage string) error
SendEmail properly formats an email with the given data and sends it via a SMTP client
func (*Controller) SendEmailVerification ¶
func (controller *Controller) SendEmailVerification(username string, email string, verification string) error
SendEmailVerification prepares a verification email and sends it to the user's given email address
func (*Controller) SendPasswordReset ¶
func (controller *Controller) SendPasswordReset(username string, email string, verification string) error
SendPasswordReset sends a verification email with a password reset link to the user's given email address
Click to show internal directories.
Click to hide internal directories.