Documentation ¶
Index ¶
- func AddRecipient(name, address string)
- func CheckPassword(plain, storedPasswordInDatabase string) bool
- func GeneratePassword(password string) (string, error)
- func RemoveRecipient(address string)
- func SendMail(subject, message string)
- func SendMailFromTemplate(templateName, subjectTemplate string)
- func SendSimpleMail(service string, port int, ...)
- func ValidateRegistration(registration *Registration) []string
- type Registration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRecipient ¶
func AddRecipient(name, address string)
AddRecipient adds a recipient in the recipients list A recipient can have "user@example.com" format OR
func CheckPassword ¶
CheckPassword compares a plain password with the equivelant hashed, returns true if they match, false otherwise
func GeneratePassword ¶
GeneratePassword generates a hashed password from a string
func RemoveRecipient ¶
func RemoveRecipient(address string)
RemoveRecipient removes the given recipient from the recipients list
func SendMail ¶
func SendMail(subject, message string)
SendMail uses all values from config subject and message must be given manually
func SendMailFromTemplate ¶
func SendMailFromTemplate(templateName, subjectTemplate string)
SendMailFromTemplate sends template based email templateName the name of the template (email body) subjectTemplate the filename of the template for the subject (email subject)
func SendSimpleMail ¶
func SendSimpleMail(service string, port int, username, password, from, to, subject, message string)
SendSimpleMail sends mail, all values are being inserted manually
func ValidateRegistration ¶
func ValidateRegistration(registration *Registration) []string
ValidateRegistration validates registration fields, returns a slice of strings containing errors if validation fails else the slice should be empty.