SendEmail is an implementation of Backend.SendEmail. It renders the template and sends the email immediately via SMTP.
(templateType, from string, to []string, data interface{})
| 100 | // SendEmail is an implementation of Backend.SendEmail. |
| 101 | // It renders the template and sends the email immediately via SMTP. |
| 102 | func (b *DefaultBackend) SendEmail(templateType, from string, to []string, data interface{}) error { |
| 103 | subject, body, err := b.Templates.Execute(templateType, EmailKindText, data) |
| 104 | if err != nil { |
| 105 | return errors.Wrap(err, "executing template") |
| 106 | } |
| 107 | |
| 108 | return b.queue(subject, from, to, EmailKindText, body) |
| 109 | } |
| 110 | |
| 111 | // queue sends the email immediately via SMTP. |
| 112 | func (b *DefaultBackend) queue(subject, from string, to []string, contentType, body string) error { |