This commit is contained in:
+6
-5
@@ -11,8 +11,8 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/mrhid6/vantage/shared/mail"
|
||||
"github.com/mrhid6/vantage/sitesvc/internal/api"
|
||||
"github.com/mrhid6/vantage/sitesvc/internal/mail"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -21,9 +21,10 @@ func main() {
|
||||
|
||||
addr := ":" + getEnv("PORT", "8082")
|
||||
|
||||
mailCfg := mail.FromEnv()
|
||||
if mailCfg.Enabled() {
|
||||
log.Printf("smtp enabled (%s) contact form delivers to %s", mailCfg.Host, mailCfg.To)
|
||||
sender := mail.FromEnv()
|
||||
contactTo := getEnv("SMTP_TO", "support@hostxtra.co.uk")
|
||||
if sender.Enabled() {
|
||||
log.Printf("smtp enabled (%s) contact form delivers to %s", sender.Host, contactTo)
|
||||
} else {
|
||||
log.Println("warning: SMTP_HOST/SMTP_FROM not set the contact form will refuse submissions")
|
||||
}
|
||||
@@ -34,7 +35,7 @@ func main() {
|
||||
|
||||
srv := &http.Server{
|
||||
Addr: addr,
|
||||
Handler: api.New(mailCfg).Routes(),
|
||||
Handler: api.New(sender, contactTo).Routes(),
|
||||
ReadHeaderTimeout: 10 * time.Second,
|
||||
ReadTimeout: 20 * time.Second,
|
||||
WriteTimeout: 30 * time.Second,
|
||||
|
||||
Reference in New Issue
Block a user