Sender represents a mail sender
type Sender struct { Template *Template // The template *Template // contains filtered or unexported fields }
func NewSender(sender_name, sender_address, password, smtp_host string, smtp_port int, template *Template) *Sender
NewSender creates a new Sender
sender_name: The name of the sender sender_address: The email address of the sender password: The password of the sender smtp_host: The smtp host (eg: smtp.gmail.com) smtp_port: The smtp port (eg: 587) template: The template *Template Returns: *Sender
func (s *Sender) SendEmail(to, subject string, query hctypes.Dict) error
SendEmail sends an email
to: The email address of the recipient subject: The subject of the email query: The query of the email template Returns: error
Template represents a mail template
type Template struct {
// contains filtered or unexported fields
}
func NewTemplate(template string) (*Template, error)
NewTemplate creates a new Template
template: The template Returns: *Template
func NewTemplateFromFile(template_file string) (*Template, error)
NewTeplateFromFile creates a new Template
template_file: The template file Returns: *Template
func (t *Template) Render(data hctypes.Dict) (string, error)
Render renders the template
data: The data Returns: string