Class: Decidim::Meetings::UpcomingMeetingNotificationJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/decidim/meetings/upcoming_meeting_notification_job.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.generate_checksum(meeting) ⇒ Object



16
17
18
# File 'app/jobs/decidim/meetings/upcoming_meeting_notification_job.rb', line 16

def self.generate_checksum(meeting)
  Digest::MD5.hexdigest("#{meeting.id}-#{meeting.start_time}")
end

Instance Method Details

#perform(meeting_id, checksum) ⇒ Object



8
9
10
11
12
13
14
# File 'app/jobs/decidim/meetings/upcoming_meeting_notification_job.rb', line 8

def perform(meeting_id, checksum)
  meeting = Decidim::Meetings::Meeting.find(meeting_id)
  return if meeting.hidden? || meeting.withdrawn?
  return unless verify_checksum(meeting, checksum)

  send_notification(meeting)
end