SendEmail is an implementation of Backend.SendEmail. It renders the template and logs the email to stdout instead of sending it.
(templateType, from string, to []string, data interface{})
| 140 | // SendEmail is an implementation of Backend.SendEmail. |
| 141 | // It renders the template and logs the email to stdout instead of sending it. |
| 142 | func (b *StdoutBackend) SendEmail(templateType, from string, to []string, data interface{}) error { |
| 143 | subject, body, err := b.Templates.Execute(templateType, EmailKindText, data) |
| 144 | if err != nil { |
| 145 | return errors.Wrap(err, "executing template") |
| 146 | } |
| 147 | |
| 148 | log.WithFields(log.Fields{ |
| 149 | "subject": subject, |
| 150 | "to": to, |
| 151 | "from": from, |
| 152 | "body": body, |
| 153 | }).Info("Email (not sent, using StdoutBackend)") |
| 154 | return nil |
| 155 | } |