使用 Elixir 和 Phoenix 发送电子邮件

Sending email with Elixir and Phoenix

我正在尝试通过 Coherence.Mailer 发送确认电子邮件。但由于某种原因,它实际上不会发送电子邮件,我只能在我的本地控制台中看到它。

配置:

config :coherence,
  user_schema: Statcasters.Coherence.User,
  repo: Statcasters.Repo,
  module: Statcasters,
  web_module: StatcastersWeb,
  router: StatcastersWeb.Router,
  messages_backend: StatcastersWeb.Coherence.Messages,
  logged_out_url: "/",
  email_from_name: "Statcasters",
  email_from_email: "my@email.com",
  opts: [:authenticatable, :recoverable, :lockable, :trackable, :unlockable_with_token, :confirmable, :registerable]

config :coherence, StatcastersWeb.Coherence.Mailer,
  adapter: Swoosh.Adapters.Sendgrid,
  api_key: {:system, "API_KEY"}

我正在使用带有 Coherence 的 Swoosh 适配器,根据文档,一切似乎都已设置好,但显然我遗漏了一些东西。

同样,问题是在本地发送的电子邮件实际上并没有发送给预期的收件人。对此有任何帮助,我们将不胜感激。

您的问题似乎与 https://github.com/smpallen99/coherence/issues/161

相似

您可以先尝试对 API_KEY 进行硬编码并进行测试,稍后检查您是否能够访问 API_KEY