Send all event reminder notifications
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
dc8faa12bd
commit
36cdcaa864
|
@ -872,7 +872,7 @@ defmodule Mobilizon.Federation.ActivityPub do
|
||||||
event_person_participation_changed: participant.actor.id
|
event_person_participation_changed: participant.actor.id
|
||||||
),
|
),
|
||||||
{:ok, _} <-
|
{:ok, _} <-
|
||||||
Scheduler.before_event_notification(participant),
|
Scheduler.trigger_notifications_for_participant(participant),
|
||||||
participant_as_data <- Convertible.model_to_as(participant),
|
participant_as_data <- Convertible.model_to_as(participant),
|
||||||
audience <-
|
audience <-
|
||||||
Audience.calculate_to_and_cc_from_mentions(participant),
|
Audience.calculate_to_and_cc_from_mentions(participant),
|
||||||
|
|
|
@ -136,7 +136,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Participant do
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
Leave an event for an actor
|
Leave an event for an anonymous actor
|
||||||
"""
|
"""
|
||||||
def actor_leave_event(
|
def actor_leave_event(
|
||||||
_parent,
|
_parent,
|
||||||
|
|
|
@ -10,6 +10,14 @@ defmodule Mobilizon.Service.Notifications.Scheduler do
|
||||||
alias Mobilizon.Users.{Setting, User}
|
alias Mobilizon.Users.{Setting, User}
|
||||||
require Logger
|
require Logger
|
||||||
|
|
||||||
|
@spec trigger_notifications_for_participant(Participant.t()) :: {:ok, nil}
|
||||||
|
def trigger_notifications_for_participant(%Participant{} = participant) do
|
||||||
|
before_event_notification(participant)
|
||||||
|
on_day_notification(participant)
|
||||||
|
weekly_notification(participant)
|
||||||
|
{:ok, nil}
|
||||||
|
end
|
||||||
|
|
||||||
def before_event_notification(%Participant{
|
def before_event_notification(%Participant{
|
||||||
id: participant_id,
|
id: participant_id,
|
||||||
event: %Event{begins_on: begins_on},
|
event: %Event{begins_on: begins_on},
|
||||||
|
|
Loading…
Reference in a new issue