Skip to content

Commit

Permalink
Remove deliver_system_email!/2
Browse files Browse the repository at this point in the history
  • Loading branch information
wmnnd committed Nov 2, 2023
1 parent 40e1f4b commit 44eff03
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
2 changes: 1 addition & 1 deletion lib/keila/auth/emails.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defmodule Keila.Auth.Emails do
def send!(email, params) do
email
|> build(params)
|> Keila.Mailer.deliver_system_email!()
|> Keila.Mailer.deliver!()
end

@spec build(:activate, %{url: String.t(), user: Keila.Auth.User.t()}) :: term() | no_return()
Expand Down
20 changes: 0 additions & 20 deletions lib/keila/mailer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,6 @@ defmodule Keila.Mailer do
alias Keila.Mailings.Sender
alias Keila.Mailings.SharedSender

@doc """
Delivers an email using the configured system mailer.
"""
@spec deliver_system_email!(Swoosh.Email.t()) :: term()
def deliver_system_email!(email) do
config =
Application.get_env(:keila, __MODULE__)
|> maybe_put_tls_opts()

deliver!(email, config)
end

defp maybe_put_tls_opts(config) do
if Keyword.get(config, :ssl) do
Keyword.put(config, :sockopts, :tls_certificate_check.options(config[:relay]))
else
config
end
end

@doc """
Delivers an email using a given sender.
"""
Expand Down

0 comments on commit 44eff03

Please sign in to comment.