Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lib/phoenix_kit_web/controllers/email_export_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ defmodule PhoenixKitWeb.Controllers.EmailExportController do
use PhoenixKitWeb, :controller

alias PhoenixKit.Emails
alias PhoenixKit.Utils.Routes

## --- Email Logs Export ---

Expand Down Expand Up @@ -64,7 +65,7 @@ defmodule PhoenixKitWeb.Controllers.EmailExportController do
else
conn
|> put_flash(:error, "Email management is not enabled")
|> redirect(to: "/phoenix_kit/admin/dashboard")
|> redirect(to: Routes.path("/admin/dashboard"))
end
end

Expand Down Expand Up @@ -102,7 +103,7 @@ defmodule PhoenixKitWeb.Controllers.EmailExportController do
else
conn
|> put_flash(:error, "Email management is not enabled")
|> redirect(to: "/phoenix_kit/admin/dashboard")
|> redirect(to: Routes.path("/admin/dashboard"))
end
end

Expand Down Expand Up @@ -131,7 +132,7 @@ defmodule PhoenixKitWeb.Controllers.EmailExportController do
else
conn
|> put_flash(:error, "Email management is not enabled")
|> redirect(to: "/phoenix_kit/admin/dashboard")
|> redirect(to: Routes.path("/admin/dashboard"))
end
end

Expand Down Expand Up @@ -169,17 +170,17 @@ defmodule PhoenixKitWeb.Controllers.EmailExportController do
Ecto.NoResultsError ->
conn
|> put_flash(:error, "Email not found")
|> redirect(to: "/phoenix_kit/admin/emails")
|> redirect(to: Routes.path("/admin/emails"))

ArgumentError ->
conn
|> put_flash(:error, "Invalid email ID")
|> redirect(to: "/phoenix_kit/admin/emails")
|> redirect(to: Routes.path("/admin/emails"))
end
else
conn
|> put_flash(:error, "Email management is not enabled")
|> redirect(to: "/phoenix_kit/admin/dashboard")
|> redirect(to: Routes.path("/admin/dashboard"))
end
end

Expand Down
Loading