diff --git a/controllers/route.go b/controllers/route.go index aa17cf78..8b5ccf5e 100644 --- a/controllers/route.go +++ b/controllers/route.go @@ -35,6 +35,7 @@ func CreateAdminRouter() http.Handler { router.HandleFunc("/templates", Use(Templates, mid.RequireLogin)) router.HandleFunc("/users", Use(Users, mid.RequireLogin)) router.HandleFunc("/landing_pages", Use(LandingPages, mid.RequireLogin)) + router.HandleFunc("/sending_profiles", Use(SendingProfiles, mid.RequireLogin)) router.HandleFunc("/register", Use(Register, mid.RequireLogin)) router.HandleFunc("/settings", Use(Settings, mid.RequireLogin)) // Create the API routes @@ -50,6 +51,8 @@ func CreateAdminRouter() http.Handler { api.HandleFunc("/templates/{id:[0-9]+}", Use(API_Templates_Id, mid.RequireAPIKey)) api.HandleFunc("/pages/", Use(API_Pages, mid.RequireAPIKey)) api.HandleFunc("/pages/{id:[0-9]+}", Use(API_Pages_Id, mid.RequireAPIKey)) + api.HandleFunc("/smtp/", Use(API_SMTP, mid.RequireAPIKey)) + api.HandleFunc("/smtp/{id:[0-9]+}", Use(API_SMTP_Id, mid.RequireAPIKey)) api.HandleFunc("/util/send_test_email", Use(API_Send_Test_Email, mid.RequireAPIKey)) api.HandleFunc("/import/group", API_Import_Group) api.HandleFunc("/import/email", API_Import_Email) @@ -69,6 +72,8 @@ func CreateAdminRouter() http.Handler { csrfHandler.ExemptGlob("/api/templates/*") csrfHandler.ExemptGlob("/api/pages") csrfHandler.ExemptGlob("/api/pages/*") + csrfHandler.ExemptGlob("/api/smtp") + csrfHandler.ExemptGlob("/api/smtp/*") csrfHandler.ExemptGlob("/api/import/*") csrfHandler.ExemptGlob("/api/util/*") csrfHandler.ExemptGlob("/static/*") @@ -309,6 +314,18 @@ func LandingPages(w http.ResponseWriter, r *http.Request) { getTemplate(w, "landing_pages").ExecuteTemplate(w, "base", params) } +// SendingProfiles handles the default path and template execution +func SendingProfiles(w http.ResponseWriter, r *http.Request) { + // Example of using session - will be removed. + params := struct { + User models.User + Title string + Flashes []interface{} + Token string + }{Title: "Dashboard", User: ctx.Get(r, "user").(models.User), Token: nosurf.Token(r)} + getTemplate(w, "sending_profiles").ExecuteTemplate(w, "base", params) +} + // Settings handles the changing of settings func Settings(w http.ResponseWriter, r *http.Request) { switch { diff --git a/static/js/sending_profiles.js b/static/js/sending_profiles.js new file mode 100644 index 00000000..e69de29b diff --git a/templates/sending_profiles.html b/templates/sending_profiles.html new file mode 100644 index 00000000..d2ef4819 --- /dev/null +++ b/templates/sending_profiles.html @@ -0,0 +1,125 @@ +{{define "body"}} +