Created
January 21, 2018 18:01
-
-
Save ntakouris/8431e13a6d9caa7214da695a96abd05d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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