package pages import ( "html/template" "net/http" ) type EmailAutoconfigTemplateData struct { Domain string DisplayName string ShortDisplayName string ImapServer string PopServer string SmtpServer string } func emailAutoconfig(w http.ResponseWriter, r *http.Request) { templateFile := "templates/email_autoconfig.tmpl" files, err := template.New(templateFile).ParseFS(content, templateFile) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } err = files.ExecuteTemplate(w, "email_autoconfig.tmpl", EmailAutoconfigTemplateData{ Domain: "prettysunflower.moe", DisplayName: "prettysunflower's mail server", ShortDisplayName: "prettysunflower", ImapServer: "mail.prettysunflower.moe", PopServer: "mail.prettysunflower.moe", SmtpServer: "mail.prettysunflower.moe", }) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } }