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.

28 lines
552 B

package main
import (
email "MY/webapp/common/email"
"fmt"
"context"
)
func main() {
ctx := context.Background()
msg := email.EmailMessage{
To: "tina.recip@example.com",
From: "toni.sender@example.com",
Subject: "This is my first mail.",
Text: fmt.Sprintf("Random number %v", 200),
HTML: fmt.Sprintf("<h1>Random number %v</h1>", 200),
}
sender := email.NewSender(ctx, email.Config{
RedisHostPort: "127.0.0.1:6379",
})
defer sender.Close()
err := sender.QueueEmail(msg)
if err != nil { panic(err) }
}