Send the membership emails in the correct language

And send them as well if the member is on the same instance 🙈

Close #472

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2020-12-01 10:21:07 +01:00
parent 8140f5e227
commit 6d8710f0fe
3 changed files with 5 additions and 4 deletions

View File

@@ -526,7 +526,8 @@ defmodule Mobilizon.Federation.ActivityPub do
local
),
:ok <- maybe_federate(activity),
:ok <- maybe_relay_if_group_activity(activity) do
:ok <- maybe_relay_if_group_activity(activity),
:ok <- Group.send_invite_to_user(member) do
{:ok, activity, member}
end
end

View File

@@ -674,8 +674,7 @@ defmodule Mobilizon.Federation.ActivityPub.Transmogrifier do
{:ok, %Actor{} = target} <-
target |> Utils.get_url() |> ActivityPub.get_or_fetch_actor_by_url(),
{:ok, activity, %Member{} = member} <-
ActivityPub.invite(object, actor, target, false, %{url: id}),
:ok <- Group.send_invite_to_user(member) do
ActivityPub.invite(object, actor, target, false, %{url: id}) do
{:ok, activity, member}
end
end