251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
# File 'lib/rails_onboarding/background_jobs.rb', line 251
def perform(user_id, notification_type, data = {})
user = find_user(user_id)
return unless user
if defined?(Noticed) && user.respond_to?(:notifications)
create_noticed_notification(user, notification_type, data)
elsif user.respond_to?(:notify)
user.notify(notification_type, data)
else
Rails.logger.info "Onboarding notification for user #{user_id}: #{notification_type}"
end
rescue StandardError => e
Rails.logger.error "Failed to send notification: #{e.message}"
raise e if should_retry?
end
|