Skip to content

Instantly share code, notes, and snippets.

@ntakouris
Created January 21, 2018 18:01
Show Gist options
  • Save ntakouris/8431e13a6d9caa7214da695a96abd05d to your computer and use it in GitHub Desktop.
Save ntakouris/8431e13a6d9caa7214da695a96abd05d to your computer and use it in GitHub Desktop.
package mailers
import (
"github.com/gobuffalo/buffalo/mail"
"github.com/gobuffalo/buffalo/render"
"github.com/pkg/errors"
)
func SendMailerName() error {
m := mail.NewMessage()
// fill in with your stuff:
m.Subject = "Mailer Name"
m.From = ""
m.To = []string{}
err := m.AddBody(r.HTML("<mailer-name>.html"), render.Data{})
if err != nil {
return errors.WithStack(err)
}
return smtp.Send(m)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment