MCPcopy Index your code
hub / github.com/dnote/dnote / SendEmail

Method SendEmail

pkg/server/mailer/backend.go:142–155  ·  view source on GitHub ↗

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{})

Source from the content-addressed store, hash-verified

140// SendEmail is an implementation of Backend.SendEmail.
141// It renders the template and logs the email to stdout instead of sending it.
142func (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}

Callers 1

Calls 3

WithFieldsFunction · 0.92
InfoMethod · 0.80
ExecuteMethod · 0.65

Tested by 1