Send all event reminder notifications

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
master
Thomas Citharel 2 years ago
parent dc8faa12bd
commit 36cdcaa864
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
  1. 2
      lib/federation/activity_pub/activity_pub.ex
  2. 2
      lib/graphql/resolvers/participant.ex
  3. 8
      lib/service/notifications/scheduler.ex

@ -872,7 +872,7 @@ defmodule Mobilizon.Federation.ActivityPub do
event_person_participation_changed: participant.actor.id
),
{:ok, _} <-
Scheduler.before_event_notification(participant),
Scheduler.trigger_notifications_for_participant(participant),
participant_as_data <- Convertible.model_to_as(participant),
audience <-
Audience.calculate_to_and_cc_from_mentions(participant),

@ -136,7 +136,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Participant do
end
@doc """
Leave an event for an actor
Leave an event for an anonymous actor
"""
def actor_leave_event(
_parent,

@ -10,6 +10,14 @@ defmodule Mobilizon.Service.Notifications.Scheduler do
alias Mobilizon.Users.{Setting, User}
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{
id: participant_id,
event: %Event{begins_on: begins_on},

Loading…
Cancel
Save