philomena/lib/philomena/mailer.ex
2024-06-02 19:08:06 -04:00

9 lines
283 B
Elixir

defmodule Philomena.Mailer do
use Swoosh.Mailer, otp_app: :philomena
@spec deliver_later(Swoosh.Email.t()) :: {:ok, Swoosh.Email.t()}
def deliver_later(mail) do
Task.Supervisor.start_child(Philomena.AsyncEmailSupervisor, fn -> deliver(mail) end)
{:ok, mail}
end
end