首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Bamboo.SentEmailViewerPlug的灵丹妙药问题

Bamboo.SentEmailViewerPlug的灵丹妙药问题
EN

Stack Overflow用户
提问于 2022-03-31 19:47:57
回答 1查看 65关注 0票数 0

我确实对上述职能有异议。这是浏览器的错误:

代码语言:javascript
复制
function Bamboo.SentEmailViewerPlug.init/1 is undefined (module Bamboo.SentEmailViewerPlug is not available)

这是来自控制台的:

代码语言:javascript
复制
[error] #PID<0.868.0> running RewardappWeb.Endpoint (connection #PID<0.829.0>, stream id 4) terminated
Server: localhost:4000 (http)
Request: GET /mailbox
** (exit) an exception was raised:
    ** (UndefinedFunctionError) function Bamboo.SentEmailViewerPlug.init/1 is undefined (module Bamboo.SentEmailViewerPlug is not available)
        Bamboo.SentEmailViewerPlug.init([])
        (phoenix 1.6.6) lib/phoenix/router/route.ex:41: Phoenix.Router.Route.call/2
        (phoenix 1.6.6) lib/phoenix/router.ex:355: Phoenix.Router.__call__/2
        (rewardapp 0.1.0) lib/rewardapp_web/endpoint.ex:1: RewardappWeb.Endpoint.plug_builder_call/2
        (rewardapp 0.1.0) lib/plug/debugger.ex:136: RewardappWeb.Endpoint."call (overridable 3)"/2
        (rewardapp 0.1.0) lib/rewardapp_web/endpoint.ex:1: RewardappWeb.Endpoint.call/2
        (phoenix 1.6.6) lib/phoenix/endpoint/cowboy2_handler.ex:54: Phoenix.Endpoint.Cowboy2Handler.init/4
        (cowboy 2.9.0) /Users/mateuszosinski/Desktop/elixir/rewardapp/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
        (cowboy 2.9.0) /Users/mateuszosinski/Desktop/elixir/rewardapp/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
        (cowboy 2.9.0) /Users/mateuszosinski/Desktop/elixir/rewardapp/deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3
        (stdlib 3.17.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

这是我的router.ex文件:

代码语言:javascript
复制
defmodule RewardappWeb.Router do
  use RewardappWeb, :router
  use Phoenix.Router

  pipeline :browser do
    plug :accepts, ["html"]
    plug :fetch_session
    plug :fetch_live_flash
    plug :put_root_layout, {RewardappWeb.LayoutView, :root}
    plug :protect_from_forgery
    plug :put_secure_browser_headers
  end

  pipeline :api do
    plug :accepts, ["json"]
  end

  scope "/", RewardappWeb do
    pipe_through :browser


    #get "/", PageController, :index
    #NEW ROUTES
    #get "/users", GrantController, :login
    get "/admin", GrantController, :admin
    get "/main", GrantController, :main
    get "/", GrantController, :index
    post "/", GrantController, :login
    get "/add", GrantController, :add
    post "/add/:id", GrantController, :update
    get "/admin/delete/:id", GrantController, :delete

  end

  if Mix.env == :dev do
    forward "/mailbox", Bamboo.SentEmailViewerPlug
  end

  # Other scopes may use custom stacks.
  # scope "/api", RewardappWeb do
  #   pipe_through :api
  # end

  # Enables LiveDashboard only for development
  #
  # If you want to use the LiveDashboard in production, you should put
  # it behind authentication and allow only admins to access it.
  # If your application does not have an admins-only section yet,
  # you can use Plug.BasicAuth to set up some basic authentication
  # as long as you are also using SSL (which you should anyway).
  if Mix.env() in [:dev, :test] do
    import Phoenix.LiveDashboard.Router

    scope "/" do
      pipe_through :browser

      live_dashboard "/dashboard", metrics: RewardappWeb.Telemetry
    end
  end

  # Enables the Swoosh mailbox preview in development.
  #
  # Note that preview only shows emails that were sent by the same
  # node running the Phoenix server.
  if Mix.env() == :dev do
    scope "/dev" do
      pipe_through :browser

      #forward "/mailbox", Plug.Swoosh.MailboxPreview
    end
  end
end

邮件发送的很好--我已经用IO.inspect检查过了,现在,它们被发送的很好。但是,我无法尝试查看localhost:4000/邮箱。我的错误在哪里?提前谢谢你!!

EN

回答 1

Stack Overflow用户

发布于 2022-03-31 20:35:48

问题是有错误的名称竹模块名称。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71698369

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档