Send an email whenever an anonymous session updates the attendance status of a guest
All checks were successful
Run unit tests / copyright_notice (pull_request) Successful in 29s
Run unit tests / rubocop (pull_request) Successful in 2m13s
Run unit tests / check-licenses (pull_request) Successful in 2m35s
Run unit tests / unit_tests (pull_request) Successful in 3m23s
Run unit tests / build-static-assets (pull_request) Successful in 18m43s

This commit is contained in:
Manuel Bustillo 2025-07-06 18:30:35 +02:00
parent ff8918a1d4
commit d236e459cd

View File

@ -22,7 +22,13 @@ class GuestsController < ApplicationController
end
def update
guest = Guest.find(params[:id]).update!(guest_params)
guest = Guest.find(params[:id])
guest.update!(guest_params)
if !user_signed_in? && guest.saved_change_to_status?
AdminMailer.with(guest_id: guest.id).attendance_change_email.deliver_later
end
render json: guest.as_json(GUEST_PARAMS), status: :ok
end