Documentation
¶
Index ¶
- type Mailer
- type TemplateMailer
- func (m *TemplateMailer) ConfirmationMail(user *models.User, referrerURL string) error
- func (m *TemplateMailer) EmailChangeMail(user *models.User, referrerURL string) error
- func (m *TemplateMailer) InviteMail(user *models.User, referrerURL string) error
- func (m *TemplateMailer) RecoveryMail(user *models.User, referrerURL string) error
- func (m TemplateMailer) Send(user *models.User, subject, body string, data map[string]interface{}) error
- func (m TemplateMailer) ValidateEmail(email string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mailer ¶
type Mailer interface {
Send(user *models.User, subject, body string, data map[string]interface{}) error
InviteMail(user *models.User, referrerURL string) error
ConfirmationMail(user *models.User, referrerURL string) error
RecoveryMail(user *models.User, referrerURL string) error
EmailChangeMail(user *models.User, referrerURL string) error
ValidateEmail(email string) error
}
Mailer defines the interface a mailer must implement.
func NewMailer ¶
func NewMailer(instanceConfig *conf.Configuration) Mailer
NewMailer returns a new gotrue mailer
type TemplateMailer ¶
type TemplateMailer struct {
SiteURL string
Config *conf.Configuration
Mailer *mailme.Mailer
}
TemplateMailer will send mail and use templates from the site for easy mail styling
func (*TemplateMailer) ConfirmationMail ¶
func (m *TemplateMailer) ConfirmationMail(user *models.User, referrerURL string) error
ConfirmationMail sends a signup confirmation mail to a new user
func (*TemplateMailer) EmailChangeMail ¶
func (m *TemplateMailer) EmailChangeMail(user *models.User, referrerURL string) error
EmailChangeMail sends an email change confirmation mail to a user
func (*TemplateMailer) InviteMail ¶
func (m *TemplateMailer) InviteMail(user *models.User, referrerURL string) error
InviteMail sends a invite mail to a new user
func (*TemplateMailer) RecoveryMail ¶
func (m *TemplateMailer) RecoveryMail(user *models.User, referrerURL string) error
RecoveryMail sends a password recovery mail
func (TemplateMailer) Send ¶
func (m TemplateMailer) Send(user *models.User, subject, body string, data map[string]interface{}) error
Send can be used to send one-off emails to users
func (TemplateMailer) ValidateEmail ¶
func (m TemplateMailer) ValidateEmail(email string) error
ValidateEmail returns nil if the email is valid, otherwise an error indicating the reason it is invalid