Class: Decidim::Conferences::UpcomingConferenceNotificationJob

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.generate_checksum(conference) ⇒ Object



13
14
15
# File 'decidim-conferences/app/jobs/decidim/conferences/upcoming_conference_notification_job.rb', line 13

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

Instance Method Details

#perform(conference_id, checksum) ⇒ Object



8
9
10
11
# File 'decidim-conferences/app/jobs/decidim/conferences/upcoming_conference_notification_job.rb', line 8

def perform(conference_id, checksum)
  conference = Decidim::Conference.find(conference_id)
  send_notification(conference) if verify_checksum(conference, checksum)
end