Skip to content

Commit

Permalink
Avoid partial merging of system mailer config with sender config
Browse files Browse the repository at this point in the history
  • Loading branch information
wmnnd committed Apr 24, 2024
1 parent 8c3166b commit bcf302c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ if config_env() == :prod do
end)
end

config(:keila, Keila.Mailer, config)
config(:keila, Keila.Auth.Emails, config)
config(:keila, Keila.Mailer, [])
rescue
e ->
exit_from_exception.(e, """
Expand Down
4 changes: 3 additions & 1 deletion lib/keila/auth/emails.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ defmodule Keila.Auth.Emails do

@spec send!(atom(), map()) :: term() | no_return()
def send!(email, params) do
config = Application.get_env(:keila, __MODULE__)

email
|> build(params)
|> Keila.Mailer.deliver!()
|> Keila.Mailer.deliver!(config)
end

@spec build(:activate, %{url: String.t(), user: Keila.Auth.User.t()}) :: term() | no_return()
Expand Down

0 comments on commit bcf302c

Please sign in to comment.