diff --git a/routers/api/mail/mail.go b/routers/api/mail/mail.go deleted file mode 100644 index dd076fb..0000000 --- a/routers/api/mail/mail.go +++ /dev/null @@ -1,38 +0,0 @@ -package mail - -import ( - "encoding/json" - - "git.umbach.dev/app-idea/mailer/modules/mailer" - "github.com/gofiber/fiber/v2" - log "github.com/sirupsen/logrus" -) - -type MailInput struct { - Key string `json:"k"` - Mail string `json:"m"` - TemplateId int `json:"t"` - LanguageId int `json:"l"` - BodyData *json.RawMessage `json:"d"` -} - -func SendMail(c *fiber.Ctx) error { - var input MailInput - - if err := c.BodyParser(&input); err != nil { - log.Infoln("bodyParser failed:", err) - return c.SendStatus(fiber.StatusUnauthorized) - } - - var bodyData map[string]interface{} - - if err := json.Unmarshal(*input.BodyData, &bodyData); err != nil { - log.Fatal(err) - } - - log.Infoln("input", input, bodyData) - - mailer.NewMail([]string{"app@roese.dev"}, input.TemplateId, input.LanguageId, bodyData) - - return c.SendStatus(fiber.StatusOK) -} diff --git a/routers/router/router.go b/routers/router/router.go deleted file mode 100644 index eebee3e..0000000 --- a/routers/router/router.go +++ /dev/null @@ -1,11 +0,0 @@ -package router - -import ( - "github.com/gofiber/fiber/v2" - - "git.umbach.dev/app-idea/mailer/routers/api/mail" -) - -func SetupRoutes(app *fiber.App) { - app.Post("/send", mail.SendMail) -}