Introduce backend for reports
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -18,7 +18,7 @@ defmodule Mobilizon.Email.User do
|
||||
|> subject(
|
||||
gettext("Mobilizon: Confirmation instructions for %{instance}", instance: instance_url)
|
||||
)
|
||||
|> put_header("Reply-To", get_config(:reply_to))
|
||||
|> put_header("Reply-To", get_config(:email_reply_to))
|
||||
|> assign(:token, user.confirmation_token)
|
||||
|> assign(:instance, instance_url)
|
||||
|> render(:registration_confirmation)
|
||||
@@ -26,7 +26,7 @@ defmodule Mobilizon.Email.User do
|
||||
|
||||
def reset_password_email(%User{} = user, locale \\ "en") do
|
||||
Gettext.put_locale(locale)
|
||||
instance_url = get_config(:instance)
|
||||
instance_url = get_config(:hostname)
|
||||
|
||||
base_email()
|
||||
|> to(user.email)
|
||||
@@ -36,7 +36,7 @@ defmodule Mobilizon.Email.User do
|
||||
instance: instance_url
|
||||
)
|
||||
)
|
||||
|> put_header("Reply-To", get_config(:reply_to))
|
||||
|> put_header("Reply-To", get_config(:email_reply_to))
|
||||
|> assign(:token, user.reset_password_token)
|
||||
|> assign(:instance, instance_url)
|
||||
|> render(:password_reset)
|
||||
@@ -45,13 +45,13 @@ defmodule Mobilizon.Email.User do
|
||||
defp base_email do
|
||||
# Here you can set a default from, default headers, etc.
|
||||
new_email()
|
||||
|> from(Application.get_env(:mobilizon, MobilizonWeb.Endpoint)[:email_from])
|
||||
|> from(get_config(:email_from))
|
||||
|> put_html_layout({Mobilizon.EmailView, "email.html"})
|
||||
|> put_text_layout({Mobilizon.EmailView, "email.text"})
|
||||
end
|
||||
|
||||
@spec get_config(atom()) :: any()
|
||||
defp get_config(key) do
|
||||
_config = Application.get_env(:mobilizon, MobilizonWeb.Endpoint) |> Keyword.get(key)
|
||||
Mobilizon.CommonConfig.instance_config() |> Keyword.get(key)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user