A small project that collects various nice things to get started with Go Web Development.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

23 lines
474 B

package features_email
import (
email "MY/webapp/common/email"
"github.com/gofiber/fiber/v2"
)
func PostApiEmailSend(c *fiber.Ctx) error {
go email.OneShotSend(email.EmailMessage{
To: c.FormValue("To"),
From: c.FormValue("From"),
Subject: c.FormValue("Subject"),
Text: c.FormValue("Message"),
HTML: c.FormValue("Message"),
})
return c.Redirect("/email/")
}
func SetupApi(app *fiber.App) {
app.Post("/api/email/send", PostApiEmailSend)
}