LoginSignup
2
0

More than 1 year has passed since last update.

PhoenixアプリでSendgridの"The from address does not match a verified Sender Identity. ..." エラーの解消

Posted at

デフォルトで

lib/supac/accounts/user_notifier.ex
# ...

  # Delivers the email using the application mailer.
  defp deliver(recipient, subject, body) do
    email =
      new()
      |> to(recipient)
      |> from({"MyApp", "contact@example.com"}) # <- cause of error
      |> subject(subject)
      |> text_body(body)

    with {:ok, _metadata} <- Mailer.deliver(email) do
      {:ok, email}
    end
  end

# ...

となっているので

lib/supac/accounts/user_notifier.ex
# ...

  # Delivers the email using the application mailer.
  defp deliver(recipient, subject, body) do
    email =
      new()
      |> to(recipient)
      |> from({"MyApp", "hoge@gmail.com"}) # <- fixed
      |> subject(subject)
      |> text_body(body)

    with {:ok, _metadata} <- Mailer.deliver(email) do
      {:ok, email}
    end
  end

# ...

などと有効なメールアドレスに変更することで解消できます。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0