Class: Decidim::Meetings::UpcomingMeetingNotificationJob

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.generate_checksum(meeting) ⇒ Object


13
14
15
# File 'decidim-meetings/app/jobs/decidim/meetings/upcoming_meeting_notification_job.rb', line 13

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
# File 'decidim-meetings/app/jobs/decidim/meetings/upcoming_meeting_notification_job.rb', line 8

def perform(meeting_id, checksum)
  meeting = Decidim::Meetings::Meeting.find(meeting_id)
  send_notification(meeting) if verify_checksum(meeting, checksum)
end